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);
  }
@Test
  public void testGetAliasesGroup_noKnownAliases() {
    List<String> singleton = RegistryAliasGroup.getAliasesGroup("something.gcr.io");
    Assert.assertEquals(1, singleton.size());
    Assert.assertEquals("something.gcr.io", singleton.get(0));
  }