public static Set getDescendantLocales()

in locales-utils/src/main/java/com/spotify/i18n/locales/utils/hierarchy/LocalesHierarchyUtils.java [54:66]


  public static Set<ULocale> getDescendantLocales(final ULocale locale) {
    Preconditions.checkNotNull(locale);
    if (isSameLocale(locale, ULocale.ROOT)) {
      // Optimization when requesting descendants of ROOT
      return Arrays.stream(ULocale.getAvailableLocales())
          .filter(uLocale -> !isSameLocale(uLocale, ULocale.ROOT))
          .collect(Collectors.toSet());
    } else {
      return Arrays.stream(ULocale.getAvailableLocales())
          .filter(ul -> isDescendantLocale(ul, locale))
          .collect(Collectors.toSet());
    }
  }