title: Java 8 - Compare multiple fields in different order using Comparator
body: <p>I like to use Java 8 <code>Comparator</code> to sort a <code>List</code> of an object based on three properties. The requirement is to sort in this order - Name ascending, Age descending, City ascending. If I use <code>reversed()</code> on `Age it reverses previously sorted entries as well. Here is what I've tried:  </p>
  
  <pre><code>Comparator.comparing((Person p) -&gt; p.getName())
            .thenComparingInt(p -&gt; p.getAge())
            .reversed()
            .thenComparing(p -&gt; p.getCity());
  </code></pre>