0
        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");
        assertEquals("xx", unknown.getLanguage());
        assertEquals("YY", unknown.getCountry());
        assertEquals("Traditional", unknown.getVariant());
 
        assertEquals("xx", unknown.getDisplayLanguage());
        assertEquals("YY", unknown.getDisplayCountry());
        assertEquals("TRADITIONAL", unknown.getDisplayVariant());
        assertEquals("xx (YY,TRADITIONAL)", unknown.getDisplayName());
    } 
 
    public void test_getDisplayName_easy() throws Exception { 
        assertEquals("English", Locale.ENGLISH.getDisplayLanguage(Locale.ENGLISH));
        assertEquals("German", Locale.GERMAN.getDisplayLanguage(Locale.ENGLISH));
        assertEquals("Englisch", Locale.ENGLISH.getDisplayLanguage(Locale.GERMAN));
Connect your IDE to all the code out there  Get Codota for Java