private static long fibonacciMod ( long n ) {
  BigInteger a = BigInteger . ZERO ;
  BigInteger b = BigInteger . ONE ;
  for ( int i = 63 ;
  i >= 0 ;
  i -- ) {
    BigInteger d = a . multiply ( b . shiftLeft ( 1 ) . subtract ( a ) ) ;
    BigInteger e = a . pow ( 2 ) . add ( b . pow ( 2 ) ) ;
    a = d ;
    b = e ;
    if ( ( ( n >>> i ) & 1 ) != 0 ) {
      BigInteger c = a . add ( b ) ;
      a = b ;
      b = c ;
    }
    a = a . mod ( MODULUS_BI ) ;
    b = b . mod ( MODULUS_BI ) ;
  }
  return a . longValue ( ) ;
}

private static long fibonacciMod ( long n ) { BigInteger a = BigInteger . ZERO ; BigInteger b = BigInteger . ONE ; for ( int i = 63 ; i >= 0 ; i -- ) { BigInteger d = a . multiply ( b . shiftLeft ( 1 ) . subtract ( a ) ) ; BigInteger e = a . pow ( 2 ) . add ( b . pow ( 2 ) ) ; a = d ; b = e ; if ( ( ( n >>> i ) & 1 ) != 0 ) { BigInteger c = a . add ( b ) ; a = b ; b = c ; } a = a . mod ( MODULUS_BI ) ; b = b . mod ( MODULUS_BI ) ; } return a . longValue ( ) ; }
(method_declaration (modifiers) type: (integral_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier))) body: (block (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (field_access object: (identifier) field: (identifier)))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (field_access object: (identifier) field: (identifier)))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (decimal_integer_literal)) update: (update_expression (identifier)) body: (block (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (method_invocation object: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (decimal_integer_literal))) name: (identifier) arguments: (argument_list (identifier))))))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (decimal_integer_literal))) name: (identifier) arguments: (argument_list (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (decimal_integer_literal))))))) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (if_statement condition: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) right: (decimal_integer_literal))) right: (decimal_integer_literal))) consequence: (block (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))))))) (return_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))))