### Question:
URI { public URL toURL() throws MalformedURLException { return URIUtils.toURL(this.delegate); } private  URI(java.net.URI delegate); String getScheme(); String getSchemeSpecificPart(); Authority getAuthority(); Path getPath(); String getQuery(); String getFragment(); boolean isOpaque(); boolean isAbsolute(); boolean isAuthoritative(); boolean isHierarchical(); boolean isRelative(); URI normalize(); URI resolve(URI target); URI relativize(URI uri); URL toURL(); URI withScheme(String scheme); URI withSchemeSpecificPart(String schemeSpecificPart); URI withAuthority(Authority authority); URI withPath(Path path); URI withQuery(String query); URI withFragment(String fragment); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); String prettyPrint(); java.net.URI unwrap(); static URI wrap(java.net.URI delegate); static URI create(String string);  }### Answer:
@Test public void testToURL$existing() throws Exception { assertThat(existing.toURL(),notNullValue()); }
@Test(expected=MalformedURLException.class) public void testToURL$nonLoaded() throws Exception { org.junit.Assume.assumeFalse(ProtocolHandlerConfigurator.isSupported("net")); custom.toURL(); }
@Test public void testToURL$loaded() throws Exception { ProtocolHandlerConfigurator.addProvider(Handler.class); assertThat(custom.toURL(),notNullValue()); }