title: How to iterate through LinkedHashMap to the xth element?
body: <p>What is the best way to iterate through a LinkedHashMap to the xth element ?</p>
  
  <pre><code>for (Entry&lt;String, Integer&gt; entry : existingFile.entrySet() )
              {
  
                  builder.append("{" + entry.getKey() + "," + entry.getValue() + "}   ");
  
              }
  </code></pre>
  
  <p>This iterates to through all the elements, how can I stop it say at the 5th element ? </p>