title: How to handle nulls when using Java collection sort
body: <p>When using Collection.sort in Java what should I return when one of the inner objects is null</p>
  
  <p>Example:</p>
  
  <pre><code>Collections.sort(list, new Comparator&lt;MyBean&gt;() {
      public int compare(MyBean o1, MyBean o2) {
        return o2.getDate().compareTo(o1.getDate());
       } 
  
  });
  </code></pre>
  
  <p>Lets say o2 is not null but o2.getDate() it is, so should I return 1 or -1 or 0 when adding a null validation?</p>