title: Efficient way to subtract values in two HashMaps by key
body: <p>I am wondering how to efficiently subtract the values of two maps when their keys match. Currently I have 2 <code>HashMap&lt;String,Integer&gt;</code> and do it like this: </p>
  
  <pre><code>for (String key: map1.keySet()){
     if (map2.keySet().contains(key)){
         //subtract
     }
  }
  </code></pre>
  
  <p>Is there a better way to do it?</p>