0
import java.util.MissingResourceException; 
 
public class LocaleTest extends junit.framework.TestCase {
    // http://b/2611311; if there's no display language/country/variant, use the raw codes. 
    public void test_getDisplayName_invalid() throws Exception { 
        Locale invalid = new Locale("AaBbCc", "DdEeFf", "GgHhIi");
 
        assertEquals("aabbcc", invalid.getLanguage());
        assertEquals("DDEEFF", invalid.getCountry());
        assertEquals("GgHhIi", invalid.getVariant());
 
        // Android using icu4c < 49.2 returned empty strings for display language, country, 
        // and variant, but a display name made up of the raw strings. 
        // Newer releases return slightly different results, but no less unreasonable. 
        assertEquals("aabbcc", invalid.getDisplayLanguage());
        assertEquals("", invalid.getDisplayCountry());
        assertEquals("DDEEFF_GGHHII", invalid.getDisplayVariant());
        assertEquals("aabbcc (DDEEFF,DDEEFF_GGHHII)", invalid.getDisplayName());
    } 
 
    // http://b/2611311; if there's no display language/country/variant, use the raw codes. 
    public void test_getDisplayName_unknown() throws Exception { 
        Locale unknown = new Locale("xx", "YY", "Traditional");
Stop searching for code, let great code find you!  Add Codota to your java IDE