title: How can I sort an ArrayList<ArrayList<String>>?
body: <p>So I'm working on a Breadth-First search function for a program I'm working on for school, and when I go through the outgoing edges for a given node, by virtue of how I'm going through my possible edges, it looks something like this:</p>
  
  <pre><code>[[A, 1], [D, 1], [C, 2], [D, 2]]
  </code></pre>
  
  <p>But what I really want is this:</p>
  
  <pre><code>[[A, 1], [C, 2], [D, 1], [D, 2]]
  </code></pre>
  
  <p>Where the first index of a pair is the name of the node that the edge points to, and the second index is the label for the edge. Essentially I want to go through these edges alphabetically, first by node name, then by label name, but I'm not sure how to do that, since Collections.sort() doesn't work for a 2D ArrayList. Any pointers/ideas on a good method to sort this? Thanks everyone!</p>
  
  <p>EDIT: I am using JRE 1.7 for this assignment, not 1.8</p>