title: What's the quickest way to remove an element from a Map by value in Java?
body: <p>What's the quickest way to remove an element from a Map by value in Java?</p>
  
  <p>Currently I'm using:</p>
  
  <pre><code>    DomainObj valueToRemove = new DomainObj();
      String removalKey = null;
  
      for (Map.Entry&lt;String, DomainObj&gt; entry : map.entrySet()) {
          if (valueToRemove.equals(entry.getValue())) {
              removalKey = entry.getKey();
              break;
          }
      }
  
      if (removalKey != null) {
          map.remove(removalKey);
      }
  </code></pre>