private static void path ( int a , int b , int st , int mask ) {
  int diffBit = Integer . highestOneBit ( mask & ( a ^ b ) ) ;
  mask = mask ^ diffBit ;
  int size = Integer . bitCount ( mask ) ;
  if ( size == 0 ) {
    path [ st ] = a ;
    path [ st + 1 ] = b ;
  }
  else {
    int otherBit = Integer . highestOneBit ( mask ) ;
    path ( a , a ^ otherBit , st , mask ) ;
    path ( a ^ diffBit ^ otherBit , b , st + ( 1 << size ) , mask ) ;
  }
}

private static void path ( int a , int b , int st , int mask ) { int diffBit = Integer . highestOneBit ( mask & ( a ^ b ) ) ; mask = mask ^ diffBit ; int size = Integer . bitCount ( mask ) ; if ( size == 0 ) { path [ st ] = a ; path [ st + 1 ] = b ; } else { int otherBit = Integer . highestOneBit ( mask ) ; path ( a , a ^ otherBit , st , mask ) ; path ( a ^ diffBit ^ otherBit , b , st + ( 1 << size ) , mask ) ; } }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier))) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (parenthesized_expression (binary_expression left: (identifier) right: (identifier)))))))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (identifier)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (block (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (identifier))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (identifier)))) alternative: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))))) (expression_statement (method_invocation name: (identifier) arguments: (argument_list (identifier) (binary_expression left: (identifier) right: (identifier)) (identifier) (identifier)))) (expression_statement (method_invocation name: (identifier) arguments: (argument_list (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (identifier)) (identifier) (binary_expression left: (identifier) right: (parenthesized_expression (binary_expression left: (decimal_integer_literal) right: (identifier)))) (identifier))))))))