class LocaleListCompat {

    @NonNull
    public static LocaleListCompat forLanguageTags(@Nullable String list) {
        if (list == null || list.isEmpty()) {
            return getEmptyLocaleList();
        } else {
            final String[] tags = list.split(",", -1);
            final Locale[] localeArray = new Locale[tags.length];
            for (int i = 0; i < localeArray.length; i++) {
                localeArray[i] = Build.VERSION.SDK_INT >= 21
                        ? Locale.forLanguageTag(tags[i])
                        : LocaleHelper.forLanguageTag(tags[i]);
            }
            LocaleListCompat instance = new LocaleListCompat();
            instance.setLocaleListArray(localeArray);
            return instance;
        }
    }

    private  LocaleListCompat();

}