It seems like roboleague kinda already does this - but not always. Maybe I broke it with some of my other mods ... I don't know. Anyway, this will ALWAYS sort them right.
This is in roboleague.XmlIO. Find the storeGroupings method and replace the first few lines with the following. Notice that the last line here is the first surviving line in the original file.
private static final Comparator GROUPING_COMPARATOR = new Comparator<Grouping>() { public int compare(Grouping o1, Grouping o2) { if (o1.competitors.length != o2.competitors.length) { return o1.competitors.length - o2.competitors.length; } Arrays.sort(o1.competitors); Arrays.sort(o2.competitors); for (int i = 0; i < o1.competitors.length; i++) { int comp = o1.competitors[i].compareTo(o2.competitors[i]); if (comp != 0) { return comp; } } return 0; } }; protected void storeGroupings(Element parent, Collection groupings) { Grouping[] groups = new Grouping[groupings.size()]; groupings.toArray(groups); Arrays.sort(groups, GROUPING_COMPARATOR); for (Grouping grouping : groups) { if (grouping.getTerminated()) {