### Question:
ImageReference { public String getRegistry() { return registry; } private  ImageReference(
      String registry, String repository, @Nullable String tag, @Nullable String digest); static ImageReference parse(String reference); static ImageReference of(
      @Nullable String registry, String repository, @Nullable String qualifier); static ImageReference of(
      @Nullable String registry, String repository, @Nullable String tag, @Nullable String digest); static ImageReference scratch(); static boolean isValidRegistry(String registry); static boolean isValidRepository(String repository); static boolean isValidTag(String tag); static boolean isValidDigest(String digest); static boolean isDefaultTag(@Nullable String tag); String getRegistry(); String getRepository(); Optional<String> getTag(); Optional<String> getDigest(); String getQualifier(); boolean usesDefaultTag(); boolean isScratch(); ImageReference withQualifier(String newQualifier); @Override String toString(); String toStringWithQualifier(); @Override boolean equals(Object other); @Override int hashCode();  }### Answer:
@Test public void testGetRegistry() { Assert.assertEquals( "registry-1.docker.io", ImageReference.of(null, "someimage", null).getRegistry()); Assert.assertEquals( "registry-1.docker.io", ImageReference.of("docker.io", "someimage", null).getRegistry()); Assert.assertEquals( "index.docker.io", ImageReference.of("index.docker.io", "someimage", null).getRegistry()); Assert.assertEquals( "registry.hub.docker.com", ImageReference.of("registry.hub.docker.com", "someimage", null).getRegistry()); Assert.assertEquals("gcr.io", ImageReference.of("gcr.io", "someimage", null).getRegistry()); }