title: Create a sorted Set while using streams
body: <p>I have a <strong>User</strong> class with <strong>name, type and age</strong> and then a long list of these users are my input <code>List&lt;User&gt; users = db.getUsers();</code>. </p>
  
  <p>I am trying to create a set of all unique users from this, but the problem is I am looking for sorting them based on the <strong>age</strong> also. I have currently used-</p>
  
  <pre><code>Set&lt;User&gt; set = users.stream().collect(Collectors.toSet());
  </code></pre>
  
  <p>How to sort this set at the same time as well, any idea?</p>