static Node addToEmpty ( Node head , int data ) {
  if ( head != null ) return head ;
  Node temp = new Node ( ) ;
  temp . data = data ;
  head = temp ;
  head . next = head ;
  return head ;
}

static Node addToEmpty ( Node head , int data ) { if ( head != null ) return head ; Node temp = new Node ( ) ; temp . data = data ; head = temp ; head . next = head ; return head ; }
(method_declaration (modifiers) type: (type_identifier) name: (identifier) parameters: (formal_parameters (formal_parameter type: (type_identifier) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier))) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (null_literal))) consequence: (return_statement (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: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (expression_statement (assignment_expression left: (field_access object: (identifier) field: (identifier)) right: (identifier))) (return_statement (identifier))))