### Question:
UrlSource implements Source { public UrlSource( URL url ) { this.url = Objects.requireNonNull( url, "url cannot be null" ); this.hashCode = Objects.hashCode( url ); } 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 testUrlSource() { try { new UrlSource( null ); fail( "Should fail, since you must specify a url" ); } catch ( NullPointerException e ) { assertEquals( "url cannot be null", e.getMessage() ); } }