Loop for the Set
<p>I have the following code:</p>

<pre><code>LinkedHashMap&lt;String,ArrayList&lt;String&gt;&gt; h;
Set set = h.entrySet();     
Iterator i = set.iterator();
        while(i.hasNext()) {
            System.out.println(i.next());
            Map.Entry me = (Map.Entry)i.next();
            String currentSegString = (String) me.getKey();

            System.out.println(currentKey+"**************");
        }
</code></pre>

<p>Prints out this:</p>

<pre><code>1=[]
2**************
3=[A, B, C]
4**************
5=[]
</code></pre>

<p>But then I remove one line <code>System.out.println(i.next());</code>:</p>

<pre><code>LinkedHashMap&lt;String,ArrayList&lt;String&gt;&gt; h;
Set set = h.entrySet();     
Iterator i = set.iterator();
        while(i.hasNext()) {

            Map.Entry me = (Map.Entry)i.next();
            String currentSegString = (String) me.getKey();

            System.out.println(currentKey+"**************");
        }
</code></pre>

<p>And it prints out this:</p>

<pre><code>1**************
2**************
3**************
4**************
5**************
</code></pre>

<p>Why doesn't it print <code>**************</code> in the first case for each key?</p>
