title: Iterating LinkedHashMap values from the key
body: <p>I'm struggling with a little bit of code, and I just cannot figure out what the correct syntax would be. Here is an example of the problem:</p>
  
  <pre><code>for (Integer key : map1.keySet()) {
  
      for (Integer value : map2.values()) {
  
          if (value == key) {
  
              // ++ the corresponding value of the looping map1 key.
              // tried statements like map1.values()++  
              // but this is an invalid operation.
  
          }
      }
  }
  </code></pre>
  
  <p>I am trying to loop <code>map1</code> keys through <code>map2</code> values and if within this process a <code>map1</code> key matches a <code>map2</code> value, I want to add one to the value of the corresponding <code>map1</code> key.</p>
  
  <p>Should be a simple problem but Eclipse keeps telling me that I have the syntax wrong, can anyone suggest what statement I may need to iterate the values?</p>