public static void main ( String [ ] args ) {
  Node newNode ;
  Node head1 = new Node ( ) ;
  head1 . data = 10 ;
  Node head2 = new Node ( ) ;
  head2 . data = 3 ;
  newNode = new Node ( ) ;
  newNode . data = 6 ;
  head2 . next = newNode ;
  newNode = new Node ( ) ;
  newNode . data = 9 ;
  head2 . next . next = newNode ;
  newNode = new Node ( ) ;
  newNode . data = 15 ;
  head1 . next = newNode ;
  head2 . next . next . next = newNode ;
  newNode = new Node ( ) ;
  newNode . data = 30 ;
  head1 . next . next = newNode ;
  head1 . next . next . next = null ;
  System . out . print ( getIntesectionNode ( head1 , head2 ) ) ;
}

public static void main ( String [ ] args ) { Node newNode ; Node head1 = new Node ( ) ; head1 . data = 10 ; Node head2 = new Node ( ) ; head2 . data = 3 ; newNode = new Node ( ) ; newNode . data = 6 ; head2 . next = newNode ; newNode = new Node ( ) ; newNode . data = 9 ; head2 . next . next = newNode ; newNode = new Node ( ) ; newNode . data = 15 ; head1 . next = newNode ; head2 . next . next . next = newNode ; newNode = new Node ( ) ; newNode . data = 30 ; head1 . next . next = newNode ; head1 . next . next . next = null ; System . out . print ( getIntesectionNode ( head1 , head2 ) ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) body: (block (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (type_identifier) arguments: (argument_list)))) (expression_statement (assignment_expression left: (field_access object: (identifier) field: (identifier)) right: (decimal_integer_literal))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (type_identifier) arguments: (argument_list)))) (expression_statement (assignment_expression left: (field_access object: (identifier) field: (identifier)) right: (decimal_integer_literal))) (expression_statement (assignment_expression left: (identifier) right: (object_creation_expression type: (type_identifier) arguments: (argument_list)))) (expression_statement (assignment_expression left: (field_access object: (identifier) field: (identifier)) right: (decimal_integer_literal))) (expression_statement (assignment_expression left: (field_access object: (identifier) field: (identifier)) right: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (object_creation_expression type: (type_identifier) arguments: (argument_list)))) (expression_statement (assignment_expression left: (field_access object: (identifier) field: (identifier)) right: (decimal_integer_literal))) (expression_statement (assignment_expression left: (field_access object: (field_access object: (identifier) field: (identifier)) field: (identifier)) right: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (object_creation_expression type: (type_identifier) arguments: (argument_list)))) (expression_statement (assignment_expression left: (field_access object: (identifier) field: (identifier)) right: (decimal_integer_literal))) (expression_statement (assignment_expression left: (field_access object: (identifier) field: (identifier)) right: (identifier))) (expression_statement (assignment_expression left: (field_access object: (field_access object: (field_access object: (identifier) field: (identifier)) field: (identifier)) field: (identifier)) right: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (object_creation_expression type: (type_identifier) arguments: (argument_list)))) (expression_statement (assignment_expression left: (field_access object: (identifier) field: (identifier)) right: (decimal_integer_literal))) (expression_statement (assignment_expression left: (field_access object: (field_access object: (identifier) field: (identifier)) field: (identifier)) right: (identifier))) (expression_statement (assignment_expression left: (field_access object: (field_access object: (field_access object: (identifier) field: (identifier)) field: (identifier)) field: (identifier)) right: (null_literal))) (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (method_invocation name: (identifier) arguments: (argument_list (identifier) (identifier))))))))