StringToURIConverter extends AbstractGenericConverter<String, URI> { @Override public URI convert(String source) { try { return new URI(source); } catch (URISyntaxException e) { throw new ConverterException(source, getTargetTypeToken().getClass(), e); } }  @Override URI convert(String source);  }
@Test public void testConvert() { URI uri = converter.convert("http: assertEquals("http", uri.getScheme()); assertEquals("www.google.com", uri.getHost()); }
@Test(expected = ConverterException.class) public void testRaiseException() { URI uri = converter.convert("&&##3"); }