public static Color toEnum ( String string ) {
  if ( string . equals ( R . name ) ) {
    return R ;
  }
  else if ( string . equals ( B . name ) ) {
    return B ;
  }
  else {
    return G ;
  }
}

public static Color toEnum ( String string ) { if ( string . equals ( R . name ) ) { return R ; } else if ( string . equals ( B . name ) ) { return B ; } else { return G ; } }
(method_declaration (modifiers) type: (type_identifier) name: (identifier) parameters: (formal_parameters (formal_parameter type: (type_identifier) name: (identifier))) body: (block (if_statement condition: (parenthesized_expression (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (field_access object: (identifier) field: (identifier))))) consequence: (block (return_statement (identifier))) alternative: (if_statement condition: (parenthesized_expression (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (field_access object: (identifier) field: (identifier))))) consequence: (block (return_statement (identifier))) alternative: (block (return_statement (identifier)))))))