### Question:
UrlConverter extends BaseConverter<URL> { public URL convert(String value) { if (isBlank(value)) { throw new ParameterException(getErrorString("a blank value", "a valid URL")); } try { return URLUtil.parseURL(value); } catch (IllegalArgumentException e) { throw new ParameterException(getErrorString(value, "a valid URL")); } } UrlConverter(String optionName); URL convert(String value);  }### Answer:
@Test public void urlIsCreatedFromFilePath() { URL url = converter.convert("/path/to/something"); assertThat(url.getPath(), endsWith("/path/to/something")); }
@Test public void urlIsCreatedFromFileUrl() { URL url = converter.convert("file:/path/to/something"); assertThat(url.toString(), is("file:/path/to/something")); }
@Test(expected = ParameterException.class) public void invalidUrlThrowsParameterException() { converter.convert("http:total nonsense"); }
@Test(expected = ParameterException.class) public void nullValueThrowsParameterException() { converter.convert(null); }