static Node exchangeNodes ( Node head ) {
  Node p = head ;
  while ( p . next . next != head ) p = p . next ;
  p . next . next = head . next ;
  head . next = p . next ;
  p . next = head ;
  head = head . next ;
  return head ;
}

static Node exchangeNodes ( Node head ) { Node p = head ; while ( p . next . next != head ) p = p . next ; p . next . next = head . next ; head . next = p . next ; p . next = head ; head = head . next ; return head ; }
(method_declaration (modifiers) type: (type_identifier) name: (identifier) parameters: (formal_parameters (formal_parameter type: (type_identifier) name: (identifier))) body: (block (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (identifier))) (while_statement condition: (parenthesized_expression (binary_expression left: (field_access object: (field_access object: (identifier) field: (identifier)) field: (identifier)) right: (identifier))) body: (expression_statement (assignment_expression left: (identifier) right: (field_access object: (identifier) field: (identifier))))) (expression_statement (assignment_expression left: (field_access object: (field_access object: (identifier) field: (identifier)) field: (identifier)) right: (field_access object: (identifier) field: (identifier)))) (expression_statement (assignment_expression left: (field_access object: (identifier) field: (identifier)) right: (field_access object: (identifier) field: (identifier)))) (expression_statement (assignment_expression left: (field_access object: (identifier) field: (identifier)) right: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (field_access object: (identifier) field: (identifier)))) (return_statement (identifier))))