public static List<String> getAliasesGroup(String registry) {
    for (ImmutableSet<String> aliasGroup : REGISTRY_ALIAS_GROUPS) {
      if (aliasGroup.contains(registry)) {
        // Found a group. Move the requested "registry" to the front before returning it.
        Stream<String> self = Stream.of(registry);
        Stream<String> withoutSelf = aliasGroup.stream().filter(alias -> !registry.equals(alias));
        return Stream.concat(self, withoutSelf).collect(Collectors.toList());
      }
    }

    return Collections.singletonList(registry);
  }
Returns the list of registry aliases for the given {@code registry}, including {@code registry}
as the first element.

@param registry the registry for which the alias group is requested
@return non-empty list of registries where {@code registry} is the first element
jib-core/src/main/java/com/google/cloud/tools/jib/registry/RegistryAliasGroup.java