### Question:
ImageName { public String getFullName() { return getFullName(null); } ImageName(String fullName);  ImageName(String fullName, String givenTag); String getRepository(); String getRegistry(); String getTag(); String getDigest(); boolean hasRegistry(); String getNameWithoutTag(); String getNameWithoutTag(String optionalRegistry); String getFullName(); String getFullName(String optionalRegistry); String getUser(); String getSimpleName(); static void validate(String image);  }### Answer:
@Test public void testRegistryNaming() throws Exception { assertEquals("docker.jolokia.org/jolokia/jolokia_demo:0.18", new ImageName("jolokia/jolokia_demo:0.18").getFullName("docker.jolokia.org")); assertEquals("docker.jolokia.org/jolokia/jolokia_demo:latest", new ImageName("jolokia/jolokia_demo").getFullName("docker.jolokia.org")); assertEquals("jolokia/jolokia_demo:latest", new ImageName("jolokia/jolokia_demo").getFullName(null)); assertEquals("docker.jolokia.org/jolokia/jolokia_demo:latest", new ImageName("docker.jolokia.org/jolokia/jolokia_demo").getFullName("another.registry.org")); assertEquals("docker.jolokia.org/jolokia/jolokia_demo:latest", new ImageName("docker.jolokia.org/jolokia/jolokia_demo").getFullName(null)); }
@Test public void testRegistryNamingExtended() throws Exception { assertEquals("docker.jolokia.org/org/jolokia/jolokia_demo:0.18", new ImageName("org/jolokia/jolokia_demo:0.18").getFullName("docker.jolokia.org")); assertEquals("docker.jolokia.org/org/jolokia/jolokia_demo:latest", new ImageName("org/jolokia/jolokia_demo").getFullName("docker.jolokia.org")); assertEquals("org/jolokia/jolokia_demo:latest", new ImageName("org/jolokia/jolokia_demo").getFullName(null)); assertEquals("docker.jolokia.org/org/jolokia/jolokia_demo:latest", new ImageName("docker.jolokia.org/org/jolokia/jolokia_demo").getFullName("another.registry.org")); assertEquals("docker.jolokia.org/org/jolokia/jolokia_demo:latest", new ImageName("docker.jolokia.org/org/jolokia/jolokia_demo").getFullName(null)); }