public static void calcFiboTerms ( ArrayList < Integer > fiboterms , int k ) {
  int i = 3 , nextTerm = 0 ;
  fiboterms . add ( 0 ) ;
  fiboterms . add ( 1 ) ;
  fiboterms . add ( 1 ) ;
  while ( true ) {
    nextTerm = fiboterms . get ( i - 1 ) + fiboterms . get ( i - 2 ) ;
    if ( nextTerm > k ) return ;
    fiboterms . add ( nextTerm ) ;
    i ++ ;
  }
}

public static void calcFiboTerms ( ArrayList < Integer > fiboterms , int k ) { int i = 3 , nextTerm = 0 ; fiboterms . add ( 0 ) ; fiboterms . add ( 1 ) ; fiboterms . add ( 1 ) ; while ( true ) { nextTerm = fiboterms . get ( i - 1 ) + fiboterms . get ( i - 2 ) ; if ( nextTerm > k ) return ; fiboterms . add ( nextTerm ) ; i ++ ; } }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (generic_type (type_identifier) (type_arguments (type_identifier))) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier))) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal)) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (decimal_integer_literal)))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (decimal_integer_literal)))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (decimal_integer_literal)))) (while_statement condition: (parenthesized_expression (true)) body: (block (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (decimal_integer_literal)))) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (decimal_integer_literal))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (return_statement)) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))) (expression_statement (update_expression (identifier)))))))