static L> pairsSortedByAComparator(Collection> l, final Comparator c) { ret sortedByComparator(l, new Comparator>() { public int compare(Pair a, Pair b) { ret c.compare(a.a, b.a); } }); }