public static List<String> computeLangFromLocale(Locale locale) {
        final List<String> resourceNames = new ArrayList<>(5);

        if (StringUtils.isBlank(locale.getLanguage())) {
            throw new IllegalArgumentException(
                "Locale \"" + locale + "\" "
                    + "cannot be used as it does not specify a language.");
        }

        resourceNames.add("default");
        resourceNames.add(locale.getLanguage());

        if (StringUtils.isNotBlank(locale.getCountry())) {
            resourceNames.add(locale.getLanguage() + "_" + locale.getCountry());
        }

        if (StringUtils.isNotBlank(locale.getVariant())) {
            resourceNames.add(
                locale.getLanguage() + "_" + locale.getCountry() + "-" + locale.getVariant());
        }
        return resourceNames;
    }
@Test
    void computeLangFromLocale() {
        List<String> languages = LanguageUtils.computeLangFromLocale(Locale.CHINA);
        assertThat(languages).isEqualTo(List.of("default", "zh", "zh_CN"));

        languages = LanguageUtils.computeLangFromLocale(Locale.CHINESE);
        assertThat(languages).isEqualTo(List.of("default", "zh"));

        languages = LanguageUtils.computeLangFromLocale(Locale.TAIWAN);
        assertThat(languages).isEqualTo(List.of("default", "zh", "zh_TW"));

        languages = LanguageUtils.computeLangFromLocale(Locale.ENGLISH);
        assertThat(languages).isEqualTo(List.of("default", "en"));

        languages = LanguageUtils.computeLangFromLocale(Locale.US);
        assertThat(languages).isEqualTo(List.of("default", "en", "en_US"));

        languages =
            LanguageUtils.computeLangFromLocale(Locale.forLanguageTag("en-US-x-lvariant-POSIX"));
        assertThat(languages).isEqualTo(List.of("default", "en", "en_US", "en_US-POSIX"));
    }