URLTypeConverter implements TypeConverter { @Override public Object convert(String value) throws ConversionException { try { return new URL(value); } catch (MalformedURLException e) { throw new ConversionException(e.getMessage()); } }  @Override Object convert(String value);  }
@Test public void validConversions() throws Exception { pc.convert("http: pc.convert("http: pc.convert("http: }
@Test(expected=ConversionException.class) public void invalidURLThrowsException() throws Exception { pc.convert("www.google.com:81/yo?id=1"); }