### Question:
UrlSource implements Source { @Override public InputStream getInputStream() throws IOException { return url.openStream(); } UrlSource( URL url ); @Override InputStream getInputStream(); @Override String getLocation(); URL getUrl(); @Override String toString(); @Override int hashCode(); @Override boolean equals( Object obj );  }### Answer:
@Test public void testGetInputStream() throws Exception { URL txtFile = new File( "target/test-classes/source.txt" ).toURI().toURL(); UrlSource source = new UrlSource( txtFile ); try ( InputStream is = source.getInputStream(); Scanner scanner = new Scanner( is ) ) { assertEquals( "Hello World!", scanner.nextLine() ); } }