title: How to sort collection with null's and invert the list afterwards?
body: <p>So I'm working with a list of Dates and some of the values are "" ie null.  I used the answer from <a href="https://stackoverflow.com/questions/3671826/how-to-handle-nulls-when-using-java-collection-sort">How to handle nulls when using Java collection sort</a> </p>
  
  <pre><code>public int compare(MyBean o1, MyBean o2) {
      if (o1.getDate() == null) {
          return (o2.getDate() == null) ? 0 : -1;
      }
      if (o2.getDate() == null) {
          return 1;
      }
      return o2.getDate().compareTo(o1.getDate());
  } 
  </code></pre>
  
  <p>to sort the list in both ascending which puts the nulls first.  </p>
  
  <p>What I want is in ascending order to have nulls first and then the values afterwards in ascending order like the above code does.  Then when descending is selected to literally flip the list.  IE first values in list are in descending order then all the nulls.</p>
  
  <p>I've attempted the following after I sorted the list in ascending order <code>Collections.reverseOrder();</code>
  This kept the nulls first and then sorted the dates in descending order.</p>
  
  <p>I also tried <code>Collections.reverse(List)</code>.  This put the nulls at the end of the list but kept the Dates in ascending order.</p>