### Question:
LocaleCache { public boolean containsLocale (@Nullable final String sLanguage) { if (sLanguage != null && sLanguage.length () > 2) { final String [] aParts = StringHelper.getExplodedArray (LocaleHelper.LOCALE_SEPARATOR, sLanguage, 3); if (aParts.length == 3) return containsLocale (aParts[0], aParts[1], aParts[2]); if (aParts.length == 2) return containsLocale (aParts[0], aParts[1], ""); } return containsLocale (sLanguage, "", ""); } protected  LocaleCache(); static boolean isSilentMode(); static boolean setSilentMode(final boolean bSilentMode); static boolean isInstantiated(); @Nonnull static LocaleCache getInstance(); @Nonnull final IMissingLocaleHandler getDefaultMissingLocaleHandler(); @Nullable Locale getLocale(@Nullable final String sLanguage); @Nullable Locale getLocaleExt(@Nullable final String sLanguage, @Nullable final IMissingLocaleHandler aMissingHandler); @Nullable Locale getLocale(@Nullable final String sLanguage, @Nullable final String sCountry); @Nullable Locale getLocale(@Nullable final String sLanguage, @Nullable final String sCountry, @Nullable final String sVariant); @Nullable Locale getLocale(@Nullable final String sLanguage,
                           @Nullable final String sCountry,
                           @Nullable final String sVariant,
                           @Nullable final IMissingLocaleHandler aMissingHandler); @Nonnull @ReturnsMutableCopy ICommonsList <Locale> getAllLocales(); @Nonnull @ReturnsMutableCopy ICommonsSet <Locale> getAllLanguages(); boolean containsLocale(@Nullable final String sLanguage); boolean containsLocale(@Nullable final String sLanguage, @Nullable final String sCountry); boolean containsLocale(@Nullable final String sLanguage, @Nullable final String sCountry, @Nullable final String sVariant); @Nonnull @ReturnsMutableCopy static ICommonsOrderedSet <Locale> getAllDefaultLocales(); final void reinitialize();  }### Answer:
@Test public void testContainsLocale () { assertFalse (LocaleCache.getInstance ().containsLocale (null)); assertFalse (LocaleCache.getInstance ().containsLocale (null)); assertTrue (LocaleCache.getInstance ().containsLocale ("de")); assertTrue (LocaleCache.getInstance ().containsLocale ("de_at")); assertFalse (LocaleCache.getInstance ().containsLocale ("de_at_var")); assertFalse (LocaleCache.getInstance ().containsLocale ("de_xx")); assertFalse (LocaleCache.getInstance ().containsLocale ("deh")); assertTrue (LocaleCache.getInstance ().containsLocale ("de", "at")); assertFalse (LocaleCache.getInstance ().containsLocale ("de", "xx")); assertFalse (LocaleCache.getInstance ().containsLocale (null, null, null)); assertTrue (LocaleCache.getInstance ().containsLocale ("de", null, null)); assertTrue (LocaleCache.getInstance ().containsLocale ("de", "at", null)); assertFalse (LocaleCache.getInstance ().containsLocale ("de", "xx", null)); assertFalse (LocaleCache.getInstance ().containsLocale ("de", "at", "var")); }