title: For each loop of Iterator skips first element
body: <p>For school I had to made a kind of linked list like queue.
  My nodes have 3 attributes:</p>
  
  <ul>
  <li>Node left (Node left of the node)</li>
  <li>Node right (Node right of the node)</li>
  <li>Object item (The object that is stored in the list)</li>
  </ul>
  
  <p>I also have to make the list iterable so implemented that interface.</p>
  
  <p>The problem I have now is that if there are for example 4 items in the list, it only shows 3 of them.</p>
  
  <p>So if for example the list has 4 strings in it, 'a', 'b', 'c' and 'd' the output is:</p>
  
  <pre><code>b
  c
  d
  </code></pre>
  
  <p>My hasNext method looks like:</p>
  
  <pre><code>@Override
          public boolean hasNext() {
              return node.getRight() != null;
          }
  </code></pre>
  
  <p>and my next method looks like:</p>
  
  <pre><code>@Override
          public T next() {
              node = node.getRight();
              Object item = node.getItem();
              return (T)item;
          }
  </code></pre>
  
  <p>If I return the item of the node instead of the node on the right I get</p>
  
  <pre><code>a
  b
  c
  </code></pre>
  
  <p>as return but that is also not good because it skips the last one. And when you read the API next should return the next value so I guess my next method has to be as it is.</p>