title: Combining map values in Java 8 with streams
body: <p>I have two <code>Map</code>s that are supposed to have the same keys (assumption).</p>
  
  <p>I need to perform an action on corresponding elements</p>
  
  <p>Java 7 code:</p>
  
  <pre><code>Map&lt;X,Y&gt; m1, m2;
  
  for (Map.Entry&lt;X,Y&gt; kvp: m1.entrySet()) {
      K key = kvp.getKey();
      Y value1 = kvp.getValue();
      Y value2 = m2.get(key);    
  
  
      doSomething(value1, value2);
  }
  </code></pre>
  
  <p>My target is to use a lambda for such operation</p>
  
  <p>Something like</p>
  
  <pre><code>Map&lt;X,Y&gt; m1, m2;
  
  [initStreamHere](m1, m2).forEachCorrespondingEntry((k, v1, v2)-&gt; doSomething(v1, v2));
  </code></pre>
  
  <p>In general, it could be cool if <code>v1</code> or <code>v2</code> is null or not according to the presence or not of the corresponding key.</p>
  
  <p>Does Java provide any such cool feature? Or is it possible to implement with custom code in less than 50 lines?</p>
  
  <p>My goal is to use a lambda expression that takes the key and the two corresponding values</p>