title: Is there a way to chain Lists (or Maps) in a for loop?
body: <p>Having this code:</p>
  
  <pre><code>Map&lt;String,Rect&gt; map1 = new HashMap&lt;String,Rect&gt;();
  Map&lt;String,Rect&gt; map2 = new HashMap&lt;String,Rect&gt;();
  ...
  for( Rect r: map1.values() ) {
      r.offset(10,10);
  }
  for( Rect r: map2.values() ) {
      r.offset(10,10);
  }
  </code></pre>
  
  <p>If the code inside both loops is the same, is there a simple way to combine the two loops into one loop? (Assume all map keys are different).<br>
  I do have some ideas that would help too (like <strong>merging the two maps</strong> into one single map or having a <strong>method</strong> doing the loop with the map as argument), but I wonder if there is something in Java syntax that just allows to chain two similar list and loop through them.</p>