static L sortedByMapElement(Collection c, final O key) { L l = new ArrayList(c); sort(l, new Comparator() { public int compare(Map a, Map b) { ret cmp(a.get(key), b.get(key)); } }); ret l; }