static int findSmallest ( int N ) {
  if ( N == 0 ) return 2 ;
  if ( N == 1 ) return 1 ;
  int prime = N , counter = 0 ;
  boolean found = false ;
  while ( ! found ) {
    if ( isPrime ( prime ) ) found = true ;
    else {
      prime ++ ;
      counter ++ ;
    }
  }
  return counter ;
}

static int findSmallest ( int N ) { if ( N == 0 ) return 2 ; if ( N == 1 ) return 1 ; int prime = N , counter = 0 ; boolean found = false ; while ( ! found ) { if ( isPrime ( prime ) ) found = true ; else { prime ++ ; counter ++ ; } } return counter ; }
(method_declaration (modifiers) type: (integral_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier))) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (return_statement (decimal_integer_literal))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (return_statement (decimal_integer_literal))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (identifier)) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (local_variable_declaration type: (boolean_type) declarator: (variable_declarator name: (identifier) value: (false))) (while_statement condition: (parenthesized_expression (unary_expression operand: (identifier))) body: (block (if_statement condition: (parenthesized_expression (method_invocation name: (identifier) arguments: (argument_list (identifier)))) consequence: (expression_statement (assignment_expression left: (identifier) right: (true))) alternative: (block (expression_statement (update_expression (identifier))) (expression_statement (update_expression (identifier))))))) (return_statement (identifier))))