title: Java 4 : Sorting an array by 2 values
body: <p>I'm currently working on a project which is in Java 4 and I have to sort an ArrayList by 2 values. This is an ArrayList of ClassTest.</p>
  <pre><code>public class ClassTest{    
      String code; // &quot;01&quot;, &quot;02&quot; or &quot;03&quot;.
      String date; // 01/01/2001.
  }
  </code></pre>
  <p>My problem is that I have to sort in first by code and after by the closest date of the current date. I'm in Java 4 and I can't use many things I usually used for sorting an Array like <code>Comparator&lt;ClassTest&gt;</code>.</p>
  <p>What algorithm can I use that isn't too slow?</p>