### Question:
DefaultImageReferenceParser implements ResourceReferenceParser { @Override public ResourceReference parse(String rawReference) { ResourceReference reference = this.defaultResourceReferenceParser.parse(rawReference); if (reference.getType().equals(ResourceType.UNKNOWN)) { reference = this.untypedImageReferenceParser.parse(rawReference); } return reference; }  @Override ResourceReference parse(String rawReference);  }### Answer:
@Test public void parseImagesCommon() { ResourceReference reference = this.parser.parse("wiki:space.page@filename"); assertEquals(ResourceType.ATTACHMENT, reference.getType()); assertEquals("wiki:space.page@filename", reference.getReference()); assertEquals("Typed = [false] Type = [attach] Reference = [wiki:space.page@filename]", reference.toString()); assertFalse(reference.isTyped()); reference = this.parser.parse("scheme: assertEquals(ResourceType.URL, reference.getType()); assertEquals("scheme: assertEquals("Typed = [false] Type = [url] Reference = [scheme: reference.toString()); assertFalse(reference.isTyped()); }
@Test public void parseImages() { ResourceReference reference = this.parser.parse("attach:wiki:space.page@filename"); assertEquals(ResourceType.ATTACHMENT, reference.getType()); assertEquals("wiki:space.page@filename", reference.getReference()); assertTrue(reference.isTyped()); assertEquals("Typed = [true] Type = [attach] Reference = [wiki:space.page@filename]", reference.toString()); reference = this.parser.parse("path:/some/image"); assertEquals(ResourceType.PATH, reference.getType()); assertEquals("/some/image", reference.getReference()); assertTrue(reference.isTyped()); assertEquals("Typed = [true] Type = [path] Reference = [/some/image]", reference.toString()); reference = this.parser.parse("icon:name"); assertEquals(ResourceType.ICON, reference.getType()); assertEquals("name", reference.getReference()); assertTrue(reference.isTyped()); assertEquals("Typed = [true] Type = [icon] Reference = [name]", reference.toString()); }