### Question:
URIDescriber { static URIDescriber newInstance(URI application, URI endpoint) { checkNotNull(application,"Application URI cannot be null"); checkNotNull(endpoint,"Endpoint URI cannot be null"); checkArgument(application.isAbsolute() && !endpoint.isOpaque(),"Application URI must be absolute hierarchical"); checkArgument(endpoint.isAbsolute() && !endpoint.isOpaque(),"Endpoint URI must be absolute hierarchical"); checkArgument(!application.relativize(endpoint).isAbsolute(),"Endpoint URI must be relative to the application one"); return new URIDescriber(application,endpoint); } private  URIDescriber(URI application, URI endpoint); @Override String toString();  }### Answer:
@Test(expected=NullPointerException.class) public void testNewInstance$nullBase() throws Exception { URIDescriber.newInstance(null, target); }
@Test(expected=NullPointerException.class) public void testNewInstance$nullTarget() throws Exception { URIDescriber.newInstance(endpoint, null); }
@Test(expected=IllegalArgumentException.class) public void testNewInstance$opaqueApplication() throws Exception { URIDescriber.newInstance(URI.create("urn:opaque"), endpoint); }
@Test(expected=IllegalArgumentException.class) public void testNewInstance$opaqueEndpoint() throws Exception { URIDescriber.newInstance(application,URI.create("urn:opaque")); }
@Test(expected=IllegalArgumentException.class) public void testNewInstance$relativeApplication() throws Exception { URIDescriber.newInstance(URI.create("relative/path"), endpoint); }
@Test(expected=IllegalArgumentException.class) public void testNewInstance$relativeEndpoint() throws Exception { URIDescriber.newInstance(application,URI.create("relativePath")); }
@Test(expected=IllegalArgumentException.class) public void testNewInstance$endpointNotRelativeFromApplication() throws Exception { URIDescriber.newInstance(application, target); }