MultilingualComparator implements Comparator<Type>, Serializable { public void setLanguage(Language language) { if (language == null) throw new IllegalArgumentException("Language must not be null"); l = language; } MultilingualComparator(Language language); void setLanguage(Language language); Language getLanguage(); int compare(Type a, Type b);  }
@Test public void testSetLanguage() { englishComparator.setLanguage(french); assertEquals(french, englishComparator.getLanguage()); try { englishComparator.setLanguage(null); fail("Setting the language to null should not be allowed"); } catch (IllegalArgumentException e) { } }