static int lehmann ( int n , int t ) {
  Random rand = new Random ( ) ;
  int a = rand . nextInt ( n - 3 ) + 2 ;
  float e = ( n - 1 ) / 2 ;
  while ( t > 0 ) {
    int result = ( ( int ) ( Math . pow ( a , e ) ) ) % n ;
    if ( ( result % n ) == 1 || ( result % n ) == ( n - 1 ) ) {
      a = rand . nextInt ( n - 3 ) + 2 ;
      t -= 1 ;
    }
    else return - 1 ;
  }
  return 1 ;
}

static int lehmann ( int n , int t ) { Random rand = new Random ( ) ; int a = rand . nextInt ( n - 3 ) + 2 ; float e = ( n - 1 ) / 2 ; while ( t > 0 ) { int result = ( ( int ) ( Math . pow ( a , e ) ) ) % n ; if ( ( result % n ) == 1 || ( result % n ) == ( n - 1 ) ) { a = rand . nextInt ( n - 3 ) + 2 ; t -= 1 ; } else return - 1 ; } return 1 ; }
(method_declaration (modifiers) type: (integral_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier))) body: (block (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (type_identifier) arguments: (argument_list)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (decimal_integer_literal)))) right: (decimal_integer_literal)))) (local_variable_declaration type: (floating_point_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (decimal_integer_literal)))) (while_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (parenthesized_expression (cast_expression type: (integral_type) value: (parenthesized_expression (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (identifier)))))) right: (identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) right: (decimal_integer_literal)) right: (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) right: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal)))))) consequence: (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: (decimal_integer_literal)))) (expression_statement (assignment_expression left: (identifier) right: (decimal_integer_literal)))) alternative: (return_statement (unary_expression operand: (decimal_integer_literal)))))) (return_statement (decimal_integer_literal))))