Can anyone explaint the output?
<p>I know the output is four one three two. Can any one explain how? Since there are five items, but only four are printed.</p>

<pre><code>TreeSet map = new TreeSet();

map.add("one");
map.add("two");
map.add("three");
map.add("four");
map.add("one");
Iterator it = map.iterator();
while (it.hasNext() ) 
{
    System.out.print( it.next() + " " );
}
</code></pre>
