title: Iterator behavior in Java
body: <p>I have a question regarding the iterator behavior in Java.</p>
  
  <p>I have a call such as this:</p>
  
  <p><code>myIterable.iterator().hasNext()</code></p>
  
  <p>If this call returns true, can I be sure that the collection has at least two elements?
  From the Java API specification, I could only find out that true means there is one more element to go which can be reached by <code>next()</code>. But what happens if the pointer is at the very beginning (meaning whether the <code>hasNext()</code> can recognize the first element separately)</p>
  
  <p><a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/util/Iterator.html" rel="nofollow">http://docs.oracle.com/javase/1.5.0/docs/api/java/util/Iterator.html</a></p>
  
  <p>it says true if the iteration has more elements. But more element could also mean the very first one?</p>
  
  <p>[Edit]</p>
  
  <p>How can I know whether the iterator has exactly two elements to iterate through? Of course, I can iterate and count, but I can't go back or iterate twice or clone the iterator in my case, this is an Hadoop iterator.</p>