222324252627282930
/** * Comparator for <code>HasName</code> instances. */ public class HasNameSort implements Comparator { public int compare(Object o1, Object o2) { HasName h1 = (HasName) o1; HasName h2 = (HasName) o2; return h1.getName().compareTo(h2.getName()); }