### Question:
RegistryAliasGroup { public static List<String> getAliasesGroup(String registry) { for (ImmutableSet<String> aliasGroup : REGISTRY_ALIAS_GROUPS) { if (aliasGroup.contains(registry)) { 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); }  static List<String> getAliasesGroup(String registry); static String getHost(String registry);  }### Answer:
@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)); }
@Test public void testGetAliasesGroup_dockerHub() { Set<String> aliases = Sets.newHashSet( "registry.hub.docker.com", "index.docker.io", "registry-1.docker.io", "docker.io"); for (String alias : aliases) { Assert.assertEquals(aliases, new HashSet<>(RegistryAliasGroup.getAliasesGroup(alias))); } }