### Question:
ImageReference { @Override public String toString() { return toString(false); } 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 testToString() throws InvalidImageReferenceException { Assert.assertEquals("someimage", ImageReference.of(null, "someimage", null).toString()); Assert.assertEquals("someimage", ImageReference.of("", "someimage", "").toString()); Assert.assertEquals( "someotherimage", ImageReference.of(null, "library/someotherimage", null).toString()); Assert.assertEquals( "someregistry/someotherimage", ImageReference.of("someregistry", "someotherimage", null).toString()); Assert.assertEquals( "anotherregistry/anotherimage:sometag", ImageReference.of("anotherregistry", "anotherimage", "sometag").toString()); Assert.assertEquals( "someimage@sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", ImageReference.of( null, "someimage", "sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") .toString()); Assert.assertEquals( "gcr.io/distroless/java@sha256:b430543bea1d8326e767058bdab3a2482ea45f59d7af5c5c61334cd29ede88a1", ImageReference.parse( "gcr.io/distroless/java@sha256:b430543bea1d8326e767058bdab3a2482ea45f59d7af5c5c61334cd29ede88a1") .toString()); }