Working of Treeset
<pre><code>import java.util.*;
public class Explorer1 
{
    public static void main(String[] args) 
    {
        TreeSet&lt;Integer&gt; s = new TreeSet&lt;Integer&gt;();
        TreeSet&lt;Integer&gt; subs = new TreeSet&lt;Integer&gt;();
        for(int i = 606; i &lt; 613; i++)  if(i%2 == 0) s.add(i);
        subs = (TreeSet)s.subSet(608, true, 611, true);
        s.add(609);
        System.out.println(s + " " + subs);
    }
}
</code></pre>

<p>O/P: [606, 608, 609, 610, 612] [608, 609, 610]<br>
 Can any explain why 609 is getting added to <code>subs</code> as it is added after assigning to object.</p>
