@Test public void testCompare() { Collections.sort(localizables, englishComparator); assertEquals(englishFirst, localizables.get(0)); Collections.sort(localizables, germanComparator); assertEquals(germanFirst, localizables.get(0)); try { Collections.sort(localizables, frenchComparator); } catch (Throwable t) { fail("Sorting with an unknown language failed"); } }
public int compare(Type a, Type b) { if (a == null && b == null) { return 0; } else if (a == null) { return 1; } else if (b == null) { return -1; } else { return a.compareTo(b, l); } }
MultilingualComparator implements Comparator<Type>, Serializable { public int compare(Type a, Type b) { if (a == null && b == null) { return 0; } else if (a == null) { return 1; } else if (b == null) { return -1; } else { return a.compareTo(b, l); } } }
MultilingualComparator implements Comparator<Type>, Serializable { public int compare(Type a, Type b) { if (a == null && b == null) { return 0; } else if (a == null) { return 1; } else if (b == null) { return -1; } else { return a.compareTo(b, l); } } MultilingualComparator(Language language); }
MultilingualComparator implements Comparator<Type>, Serializable { public int compare(Type a, Type b) { if (a == null && b == null) { return 0; } else if (a == null) { return 1; } else if (b == null) { return -1; } else { return a.compareTo(b, l); } } MultilingualComparator(Language language); void setLanguage(Language language); Language getLanguage(); int compare(Type a, Type b); }
MultilingualComparator implements Comparator<Type>, Serializable { public int compare(Type a, Type b) { if (a == null && b == null) { return 0; } else if (a == null) { return 1; } else if (b == null) { return -1; } else { return a.compareTo(b, l); } } MultilingualComparator(Language language); void setLanguage(Language language); Language getLanguage(); int compare(Type a, Type b);  }