code: private void indexPermutations(MetaLocale bundleId) {
      MetaLocale key = bundleId.copy();
      for (int flags : LanguageResolver.MATCH_ORDER) {
        LanguageResolver.set(bundleId, key, flags);
        MetaLocale maxBundleId = languageResolver.addLikelySubtags(key);
        MetaLocale source = availableBundlesMap.get(maxBundleId);
        if (source != null) {
          availableBundlesMap.putIfAbsent(key.copy(), source);
        } else if (maxBundleId.hasVariant()) {
          maxBundleId.setVariant(null);
          source = availableBundlesMap.get(maxBundleId);
          if (source != null) {
            availableBundlesMap.putIfAbsent(key.copy(), source);
          }
        }
      }
    }
docs: Index permutations of the given bundle identifier. We iterate over the field
  permutations and expand each to the maximum bundle identifier, then query
  to see if that max bundle identifier matches a bundle.  Then we index the
  permutation to that bundle. This creates a static mapping mimicking a dynamic lookup.