### Question:
VfsResourceReferenceConverter extends AbstractConverter<VfsResourceReference> { @Override protected VfsResourceReference convertToType(Type targetType, Object value) { if (value == null) { return null; } VfsResourceReference reference; try { reference = new VfsResourceReference(value.toString()); } catch (Exception e) { throw new ConversionException( String.format("Failed to convert [%s] to a VFS Resource Reference", value), e); } return reference; }    }### Answer:
@Test public void convertWithNull() { assertNull(this.vfsResourceReferenceConverter.convertToType(null, null)); }
@Test public void convertWithString() throws Exception { String value = "attach:Toto.WebHome@testvfs.zip VfsResourceReference expectedReference = new VfsResourceReference(URI.create(value)); assertEquals(expectedReference, this.vfsResourceReferenceConverter.convertToType(null, value)); }
@Test public void convertWithSpecialString() throws Exception { String value = "attach:Toto.WebHome@testvfs.zip VfsResourceReference expectedReference = new VfsResourceReference("attach:Toto.WebHome@testvfs.zip assertEquals(expectedReference, this.vfsResourceReferenceConverter.convertToType(null, value)); }