public static int findNextPrime ( int n ) {
  int nextPrime = n + 2 ;
  while ( true ) {
    if ( isPrime ( nextPrime ) == true ) break ;
    nextPrime ++ ;
  }
  return nextPrime ;
}

public static int findNextPrime ( int n ) { int nextPrime = n + 2 ; while ( true ) { if ( isPrime ( nextPrime ) == true ) break ; nextPrime ++ ; } return nextPrime ; }
(method_declaration (modifiers) type: (integral_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier))) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (identifier) right: (decimal_integer_literal)))) (while_statement condition: (parenthesized_expression (true)) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (method_invocation name: (identifier) arguments: (argument_list (identifier))) right: (true))) consequence: (break_statement)) (expression_statement (update_expression (identifier))))) (return_statement (identifier))))