LocalizableObject implements Localizable { public void setDefaultLanguage(Language language) { if (language == null && behavior.equals(Default)) throw new IllegalArgumentException("Default language may not be null while language resolution is set to default"); defaultLanguage = language; } LocalizableObject();  LocalizableObject(Language defaultLanguage); void addLocalizationListener(LocalizationListener listener); void removeLocalizationListener(LocalizationListener listener); void enableLanguage(Language language); void disableLanguage(Language language); Language switchTo(Language language); Language switchTo(Language language, boolean force); Language getLanguage(); void setLanguageResolution(LanguageResolution behavior); LanguageResolution getLanguageResolution(); void setDefaultLanguage(Language language); Language getDefaultLanguage(); Language getOriginalLanguage(); void setOriginalLanguage(Language language); boolean supportsLanguage(Language language); Set<Language> languages(); int compareTo(Localizable o, Language l); String toString(); String toString(Language language); String toString(Language language, boolean force);  }
@Test public void testSetDefaultLanguage() { content.setDefaultLanguage(null); content.setDefaultLanguage(french); assertEquals(french, content.getDefaultLanguage()); try { content.setLanguageResolution(LanguageResolution.Default); content.setDefaultLanguage(null); fail("Setting the default language to null should be prohited in this case"); } catch (IllegalArgumentException e) { } }