title: Sorting an ArrayList of objects using a custom sorting order
body: <p>I am looking to implement a sort feature for my address book application.</p>
  
  <p>I want to sort an <code>ArrayList&lt;Contact&gt; contactArray</code>. <code>Contact</code> is a class which contains four fields: name, home number, mobile number and address. I want to sort on <code>name</code>.</p>
  
  <p>How can I write a custom sort function to do this?</p>