public static List<Locale> languagesByCountry(String countryCode)
    {
        if (countryCode == null)
        {
            return Collections.emptyList();
        }
        List<Locale> langs = LANGUAGES_BY_COUNTRY.get(countryCode);
        if (langs == null)
        {
            langs = new ArrayList<Locale>();
            List<Locale> locales = availableLocaleList();
            for (int i = 0; i < locales.size(); i++)
            {
                Locale locale = locales.get(i);
                if (countryCode.equals(locale.getCountry()) &&
                        locale.getVariant().length() == 0)
                {
                    langs.add(locale);
                }
            }
            langs = Collections.unmodifiableList(langs);
            LANGUAGES_BY_COUNTRY.putIfAbsent(countryCode, langs);
            langs = LANGUAGES_BY_COUNTRY.get(countryCode);
        }
        return langs;
    }
public static List < Locale > languagesByCountry ( String countryCode ) { if ( countryCode == null ) { return Collections . emptyList ( ) ; } List < Locale > langs = LANGUAGES_BY_COUNTRY . get ( countryCode ) ; if ( langs == null ) { langs = new ArrayList < Locale > ( ) ; List < Locale > locales = availableLocaleList ( ) ; for ( int i = 0 ; i < locales . size ( ) ; i ++ ) { Locale locale = locales . get ( i ) ; if ( countryCode . equals ( locale . getCountry ( ) ) && locale . getVariant ( ) . length ( ) == 0 ) { langs . add ( locale ) ; } } langs = Collections . unmodifiableList ( langs ) ; LANGUAGES_BY_COUNTRY . putIfAbsent ( countryCode , langs ) ; langs = LANGUAGES_BY_COUNTRY . get ( countryCode ) ; } return langs ; }
<p>Obtains the list of languages supported for a given country.</p>

<p>This method takes a country code and searches to find the
languages available for that country. Variant locales are removed.</p>

@param countryCode  the 2 letter country code, null returns empty
@return an unmodifiable List of Locale objects, not null