### Question:
URL implements Iterable<URL.Parameter> { public URL setProtocol(String protocol) throws IllegalArgumentException { Protocol.valueOf(protocol.toLowerCase()); return this; } URL(java.net.URI uri);  URL(java.net.URL url);  URL(String url); static URL get(String url); static URL get(String url, URL defaul); static boolean isValid(String url); URL addParameter(String name, int value); URL clone(); URL addParameter(String name, String value); URL decrementParameter(String name); @Override /** * Compares this object with a similar object, String, java.net.URL, java.netURI. Returns true if the external form of the URL is identical. */ boolean equals(Object anObject); String getFragment(); String getHost(); int getParameter(String name, int defaul); String getParameter(String name, String defaul); String[] getParameters(String name); String getPassword(); String getPath(); List<String> getPathElements(); String getParentDirectory(String child); String getChildDirectory(String parent); int getPort(); Protocol getProtocol(); String getUsername(); URL resolveRelative(String relativePath); URL incrementParameter(String name); Iterator<Parameter> iterator(); URL removeFragment(); URL removeParameter(String... name); URL setFragment(String fragment); URL setHost(String host); URL setParameter(String name, int value); URL setParameter(String name, String value); URL setPassword(String password); URL setPath(String path); URL setPort(int port); URL setProtocol(String protocol); URL setUsername(String username); @Override /** * Returns the full external form of the url. */ String toString(); String toStringFull(); String getQueryString(); String getFragmentString(); String toStringRelative(URL relativeTo); java.net.URL toJavaURL(); java.net.URI toJavaURI(); String getAuthority(); boolean matchesAuthority(String authority); boolean matchesAuthority(URL url); boolean matchesAuthority(String... authority); int getAuthoritySize(); String getAuthority(int i);  }### Answer:
@Test public void testExceptions() throws Exception { try { String nullString = null; new URL(nullString); Assert.fail("NullPointerException expected"); } catch (NullPointerException e) { } try { new URL("htxp: Assert.fail("IllegalArgumentException expected"); } catch (IllegalArgumentException e) { } try { URL u = new URL("http: u.setProtocol("xttp"); Assert.fail("IllegalArgumentException expected"); } catch (IllegalArgumentException e) { } try { new URL(""); Assert.fail("IllegalArgumentException expected"); } catch (IllegalArgumentException e) { } }