public static void search ( List < Integer > [ ] adjLists , boolean [ ] visited , int node , boolean condTree ) {
  visited [ node ] = true ;
  if ( condTree ) {
    count1 ++ ;
  }
  else {
    count2 ++ ;
  }
  for ( int adj : adjLists [ node ] ) {
    if ( ! visited [ adj ] ) {
      search ( adjLists , visited , adj , ! condTree ) ;
    }
  }
}

public static void search ( List < Integer > [ ] adjLists , boolean [ ] visited , int node , boolean condTree ) { visited [ node ] = true ; if ( condTree ) { count1 ++ ; } else { count2 ++ ; } for ( int adj : adjLists [ node ] ) { if ( ! visited [ adj ] ) { search ( adjLists , visited , adj , ! condTree ) ; } } }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (generic_type (type_identifier) (type_arguments (type_identifier))) dimensions: (dimensions)) name: (identifier)) (formal_parameter type: (array_type element: (boolean_type) dimensions: (dimensions)) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier)) (formal_parameter type: (boolean_type) name: (identifier))) body: (block (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (true))) (if_statement condition: (parenthesized_expression (identifier)) consequence: (block (expression_statement (update_expression (identifier)))) alternative: (block (expression_statement (update_expression (identifier))))) (enhanced_for_statement type: (integral_type) name: (identifier) value: (array_access array: (identifier) index: (identifier)) body: (block (if_statement condition: (parenthesized_expression (unary_expression operand: (array_access array: (identifier) index: (identifier)))) consequence: (block (expression_statement (method_invocation name: (identifier) arguments: (argument_list (identifier) (identifier) (identifier) (unary_expression operand: (identifier)))))))))))