title: How to sort alphabetically treeset consisting of custom class objects by one of their fields
body: <p>I have treeset of custom class, which consists of string with its name, which I want to be sorted alphabetically, and another treeset. I want to sort this class, but I have no idea how. I tried something like this, but I have no idea, what should I write in place of "???". Or maybe should it be done completely differently?</p>
  
  <pre><code>public class Turniej 
  {
  Set&lt;Zawody&gt;zaw = new TreeSet&lt;Zawody&gt;
  (
  new Comparator&lt;Zawody&gt;()
  {
      public int compare(Zawody z1, Zawody z2)
      {
        ???
      }
  }
  )
  ;      
  ....
  }
  
  public class Zawody 
  {
  String nazwaZawodow;
  SortedSet&lt;Start&gt; start = new TreeSet&lt;Start&gt;
  ...
  }
  </code></pre>