title: How to find the root element of a TreeSet
body: <p>I have a tree set. How to find the root element of the treeset:</p>
  
  <pre><code>TreeSet&lt;Integer&gt; ts = new TreeSet&lt;Integer&gt;();
      ts.add(8);
      ts.add(3);
      ts.add(8);
      ts.add(1);
      ts.add(0);
      ts.add(4);
      ts.add(7);
  </code></pre>
  
  <p>If we are taking the below treeset, 20 is the root element:
  <a href="https://i.stack.imgur.com/4lTrv.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4lTrv.png" alt="TreeSet"></a></p>