### Question:
URIDescriptor { public static URIDescriptor create(URI target) { if(target==null) { throw new NullPointerException("URI cannot be null"); } if(target.isOpaque()) { throw new IllegalArgumentException("URI must be hierarchical"); } URI targetDir = target.resolve("."); String targetFile=target.getPath().substring(targetDir.getPath().length()); String targetQuery = target.getQuery(); String targetFragment=target.getFragment(); return new URIDescriptor(target,targetDir.getPath(),targetFile,targetQuery,targetFragment); } private  URIDescriptor(
		URI uri,
		String dir,
		String file,
		String query,
		String fragment); URI getUri(); String getDir(); String getFile(); boolean isDir(); String getQuery(); String getFragment(); @Override String toString(); static URIDescriptor create(URI target);  }### Answer:
@Test(expected=NullPointerException.class) public void testCreate$null() throws Exception { URIDescriptor.create(null); }
@Test(expected=IllegalArgumentException.class) public void testCreate$opaque() throws Exception { URIDescriptor.create(uri("urn:opaque:uri")); }
@Test public void testCreate$relative() throws Exception { testCase(null,DIR,EMPTY_STRING,null,null); }
@Test public void testCreate$rootFile() throws Exception { testCase(AUTHORITY, ROOT_DIR, FILE, null, null); }
@Test public void testCreate$rootFile$fragment() throws Exception { testCase(AUTHORITY, ROOT_DIR, FILE, null, FRAGMENT); }
@Test public void testCreate$rootFile$query() throws Exception { testCase(AUTHORITY, ROOT_DIR, FILE, QUERY, null); }
@Test public void testCreate$rootFile$composite() throws Exception { testCase(AUTHORITY, ROOT_DIR, FILE, QUERY, FRAGMENT); }
@Test public void testCreate$directory() throws Exception { testCase(AUTHORITY, DIR, EMPTY_STRING, null, null); }
@Test public void testCreate$directory$fragment() throws Exception { testCase(AUTHORITY, DIR, EMPTY_STRING, null, FRAGMENT); }
@Test public void testCreate$directory$query() throws Exception { testCase(AUTHORITY, DIR, EMPTY_STRING, QUERY, null); }
@Test public void testCreate$directory$composite() throws Exception { testCase(AUTHORITY, DIR, EMPTY_STRING, QUERY, FRAGMENT); }
@Test public void testCreate$file() throws Exception { testCase(AUTHORITY, DIR, FILE, null, null); }
@Test public void testCreate$file$fragment() throws Exception { testCase(AUTHORITY, DIR, FILE, null, FRAGMENT); }
@Test public void testCreate$file$query() throws Exception { testCase(AUTHORITY, DIR, FILE, QUERY, null); }
@Test public void testCreate$file$composite() throws Exception { testCase(AUTHORITY, DIR, FILE, QUERY, FRAGMENT); }