### Question:
URLStreamHandlerFactory { URLStreamHandler createForScheme(String scheme, String... providers) { return createForScheme(scheme,Arrays.asList(providers)); } private  URLStreamHandlerFactory(boolean debug, boolean trace, ClassInstantiator instantiator);   URLStreamHandlerFactory(boolean debug, boolean trace);   URLStreamHandlerFactory(ClassInstantiator instantiator);   }### Answer:
@Test public void testCreateHandlerForScheme$existing() throws Exception { URLStreamHandlerFactory sut=new URLStreamHandlerFactory(true, true); URLStreamHandler result = sut.createForScheme("net", "org.ldp4j.commons"); assertThat(result,instanceOf(Handler.class)); }
@Test public void testCreateHandlerForScheme$notExisting() throws Exception { URLStreamHandlerFactory sut=new URLStreamHandlerFactory(true, true); URLStreamHandler result = sut.createForScheme("set", "org.ldp4j.commons"); assertThat(result,nullValue()); }
@Test public void testCreateHandlerForScheme$failure() throws Exception { FailingInstantiator instantiator = new FailingInstantiator(); URLStreamHandlerFactory sut=new URLStreamHandlerFactory(instantiator); for(FailingInstantiator.Failure failure:FailingInstantiator.Failure.values()) { instantiator.setFailure(failure); URLStreamHandler result = sut.createForScheme("set", "org.ldp4j.commons"); assertThat(result,nullValue()); } }