title: Groovy list sort on two criteria
body: <p>I have a list of objects which are all the same type and have two properties a 'uniqueId', and a 'secondaryId'. I want to sort this list first by 'uniqueId' and then by 'secondaryId' for each uniqueId so that this list:</p>
  
  <p>UniqueID/SecondaryID
  5/3
  2/6
  5/8
  2/5</p>
  
  <p>once sorted will look like:
  2/5
  2/6
  5/3
  5/8</p>
  
  <p>I can't seem to get the syntax quite right:</p>
  
  <pre><code>return searchResults.sort{[it.uniqueId, it.secondaryId]}
  </code></pre>
  
  <p>is what I am trying to start with but that didn't work.</p>