AndroidLocaleType extends LocaleType { @Override public String getTargetLocaleRepresentation(String targetLocale) { Locale forLanguageTag = Locale.forLanguageTag(targetLocale); String androidLocale = forLanguageTag.getLanguage(); if (!Strings.isNullOrEmpty(forLanguageTag.getCountry())) { androidLocale += "-r" + forLanguageTag.getCountry(); } return androidLocale; }  @Override String getTargetLocaleRegex(); @Override String getTargetLocaleRepresentation(String targetLocale);  }
@Test public void testGetTargetLocaleRepresentationNoRegion() { String targetLocale = "fr"; AndroidLocaleType instance = new AndroidLocaleType(); String expResult = "fr"; String result = instance.getTargetLocaleRepresentation(targetLocale); assertEquals(expResult, result); }
@Test public void testGetTargetLocaleRepresentationWithRegion() { String targetLocale = "en-GB"; AndroidLocaleType instance = new AndroidLocaleType(); String expResult = "en-rGB"; String result = instance.getTargetLocaleRepresentation(targetLocale); assertEquals(expResult, result); }