static boolean isCircular ( Node head ) {
  if ( head == null ) return true ;
  Node node = head . next ;
  while ( node != null && node != head ) node = node . next ;
  return ( node == head ) ;
}

static boolean isCircular ( Node head ) { if ( head == null ) return true ; Node node = head . next ; while ( node != null && node != head ) node = node . next ; return ( node == head ) ; }
(method_declaration (modifiers) type: (boolean_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (type_identifier) name: (identifier))) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (null_literal))) consequence: (return_statement (true))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (field_access object: (identifier) field: (identifier)))) (while_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (null_literal)) right: (binary_expression left: (identifier) right: (identifier)))) body: (expression_statement (assignment_expression left: (identifier) right: (field_access object: (identifier) field: (identifier))))) (return_statement (parenthesized_expression (binary_expression left: (identifier) right: (identifier))))))