public boolean isScratch() {
    return "".equals(registry)
        && SCRATCH.equals(repository)
        && Strings.isNullOrEmpty(tag)
        && Strings.isNullOrEmpty(digest);
  }
@Test
  public void testIsScratch() throws InvalidImageReferenceException {
    Assert.assertTrue(ImageReference.parse("scratch").isScratch());
    Assert.assertTrue(ImageReference.scratch().isScratch());
    Assert.assertFalse(ImageReference.of("", "scratch", "").isScratch());
    Assert.assertFalse(ImageReference.of(null, "scratch", null).isScratch());
  }