title: Group and then sort a list using java comparator
body: <p>i have a list that contains product items and when it was purchased. is it possible to use comparator java to first sort this list out by the product description, and then sort it by date purchased as well?</p>
  
  <p>So far i can use it sort out the list in order of dates or description or another field but i want to know if it is possible to sort it by using multiple fields?</p>
  
  <p>here is what i have so far that sorts the dates fine.</p>
  
  <pre><code>public int compare(Transaction aTransaction1, Transaction aTransaction2)
      {
          Date lTransactionDate1 = aTransaction1.getTransactionDate();
          Date lTransactionDate2 = aTransaction2.getTransactionDate();
  
          return lTransactionDate2.compareTo(lTransactionDate1);
      }
  </code></pre>
  
  <p>Thanks in advance.</p>