Actually, most of the API classes have overloaded methods / constructors that take a Comparator for custom sorting as well. The TreeMap / TreeSet constructors, Collections.sort and Arrays.sort sure do.