title: Java sort list containing list on index value of list?
body: <p>I have a nested list like below (but it has 1,000's of the <code>holder</code> lists within the one main list). Say I need to sort the main list <code>listEmailData</code> by the value for each of its <code>holder</code> lists on the <code>holder.get(2)</code> index. I can't seem to figure out how to do this any advice is appreciated.</p>
  
  <pre><code>ArrayList listEmailData;
  
  ArrayList holder = new ArrayList();
  
  listEmailData.add(3)
  listEmailData.add(323)
  listEmailData.add(2342)
  
  listEmailData.add(holder)
  </code></pre>
  
  <p>EDIT: To clarify, I have a list where each list entry contains a sub-list, within this sub-list a specific index contains a value that is a ranking. I need to sort the main list based on this ranking value within each sub-list.</p>
  
  <p>2ND EDIT: Thanks for the help on this, got it working but its seems that its putting larger numbers first and large numbers later, I was hoping to reverse this so it goes from largest to smallest as I am</p>