title: Sorting LocalDateTime
body: <p>How to sort <code>LocalDateTime</code> objects?</p>
  
  <p>I tried the following:</p>
  
  <pre><code>Comparator&lt;Data&gt; comparator = new Comparator&lt;Data&gt;() {
      @Override
      public int compare(final data o1, final data o2) {
          if (o1.getDate()== null || o2.getDate() == null)
              return 0;
          return o1.getDate().compareTo(o2.getDate());
      }
  };
  
  Collections.sort(comments, comparator);
  </code></pre>
  
  <p>After testing I think it sorts according to the date, but is the time part (HH:MM:SS) ignored?</p>