static Color getColor ( int rate ) {
  for ( Color color : values ( ) ) if ( color . min <= rate && rate <= color . max ) return color ;
  return null ;
}

static Color getColor ( int rate ) { for ( Color color : values ( ) ) if ( color . min <= rate && rate <= color . max ) return color ; return null ; }
(method_declaration (modifiers) type: (type_identifier) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier))) body: (block (enhanced_for_statement type: (type_identifier) name: (identifier) value: (method_invocation name: (identifier) arguments: (argument_list)) body: (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (field_access object: (identifier) field: (identifier)) right: (identifier)) right: (binary_expression left: (identifier) right: (field_access object: (identifier) field: (identifier))))) consequence: (return_statement (identifier)))) (return_statement (null_literal))))