### Question:
LocalizationUtils { public static LocalizedString getLocalizedElement(LocalizedString[] elements, String[] locales) { if (elements == null) { return null; } elements = processElementsByLocales(elements, locales); if (elements.length == 0) { return null; } return elements[0]; } private  LocalizationUtils(); static LocalizedString getLocalizedElement(LocalizedString[] elements, String[] locales); static LocalizedString[] processElementsByLocales(LocalizedString[] elements, String[] locales); static LocalizedString[] processElementsByDefaultLocales(LocalizedString[] elements); static List<ULocale> getProcessedLocaleList(String[] locales); static boolean isValidLanguageTag(String tag);  }### Answer:
@Test public void testGetLocalizedElement() { LocalizedString[] elements = new LocalizedString[3]; elements[0] = new LocalizedString("Hello World", "en"); elements[1] = new LocalizedString("你好世界", "cn"); elements[2] = new LocalizedString("Nom de plume!", "fr"); LocalizedString testMatch = new LocalizedString("Nom de plume!", "fr"); String[] locales = { "es", "fr", "en" }; LocalizedString bestMatch = LocalizationUtils.getLocalizedElement( elements, locales); assertTrue("Localized element best match returned correctly",bestMatch.getValue().equals(testMatch.getValue())); }