public static boolean isPrime ( long n ) {
  if ( n < 2 ) return false ;
  if ( n == 2 || n == 3 ) return true ;
  if ( n % 2 == 0 || n % 3 == 0 ) return false ;
  long sqrtN = ( long ) Math . sqrt ( n ) + 1 ;
  for ( long i = 6L ;
  i <= sqrtN ;
  i += 6 ) {
    if ( n % ( i - 1 ) == 0 || n % ( i + 1 ) == 0 ) return false ;
  }
  return true ;
}

public static boolean isPrime ( long n ) { if ( n < 2 ) return false ; if ( n == 2 || n == 3 ) return true ; if ( n % 2 == 0 || n % 3 == 0 ) return false ; long sqrtN = ( long ) Math . sqrt ( n ) + 1 ; for ( long i = 6L ; i <= sqrtN ; i += 6 ) { if ( n % ( i - 1 ) == 0 || n % ( i + 1 ) == 0 ) return false ; } return true ; }
(method_declaration (modifiers) type: (boolean_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 (false))) (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (binary_expression left: (identifier) right: (decimal_integer_literal)))) consequence: (return_statement (true))) (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (decimal_integer_literal)) right: (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (decimal_integer_literal)))) consequence: (return_statement (false))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (cast_expression type: (integral_type) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))) right: (decimal_integer_literal)))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (identifier)) update: (assignment_expression left: (identifier) right: (decimal_integer_literal)) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (binary_expression left: (identifier) right: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal)))) right: (decimal_integer_literal)) right: (binary_expression left: (binary_expression left: (identifier) right: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal)))) right: (decimal_integer_literal)))) consequence: (return_statement (false))))) (return_statement (true))))