public static < K , V > K getKey ( Map < K , V > map , V value ) {
  for ( Map . Entry < K , V > entry : map . entrySet ( ) ) {
    if ( value . equals ( entry . getValue ( ) ) ) {
      return entry . getKey ( ) ;
    }
  }
  return null ;
}

public static < K , V > K getKey ( Map < K , V > map , V value ) { for ( Map . Entry < K , V > entry : map . entrySet ( ) ) { if ( value . equals ( entry . getValue ( ) ) ) { return entry . getKey ( ) ; } } return null ; }
(method_declaration (modifiers) type_parameters: (type_parameters (type_parameter (type_identifier)) (type_parameter (type_identifier))) type: (type_identifier) name: (identifier) parameters: (formal_parameters (formal_parameter type: (generic_type (type_identifier) (type_arguments (type_identifier) (type_identifier))) name: (identifier)) (formal_parameter type: (type_identifier) name: (identifier))) body: (block (enhanced_for_statement type: (generic_type (scoped_type_identifier (type_identifier) (type_identifier)) (type_arguments (type_identifier) (type_identifier))) name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)) body: (block (if_statement condition: (parenthesized_expression (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))))) consequence: (block (return_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))))))) (return_statement (null_literal))))