### Question:
HTTPRequest { public final void setUrl(String url) throws ParseException, URLException { if (!isAbsolute(url)) { throw new URLException("URL must be absolute"); } m_defaultURL = new URI(url); } HTTPRequest(); final String getUrl(); final void setUrl(String url); final NVPair[] getHeaders(); final void setHeaders(NVPair[] headers); String toString(); final byte[] getData(); final void setData(byte[] data); final byte[] setDataFromFile(String filename); final NVPair[] getFormData(); final void setFormData(NVPair[] formData); boolean getReadResponseBody(); void setReadResponseBody(boolean b); final HTTPResponse DELETE(); final HTTPResponse DELETE(String uri); final HTTPResponse DELETE(final String uri, NVPair[] headers); final HTTPResponse GET(); final HTTPResponse GET(String uri); final HTTPResponse GET(NVPair[] queryData); final HTTPResponse GET(final String uri, final NVPair[] queryData); final HTTPResponse GET(final String uri,
                                final NVPair[] queryData,
                                NVPair[] headers); final HTTPResponse HEAD(); final HTTPResponse HEAD(String uri); final HTTPResponse HEAD(NVPair[] queryData); final HTTPResponse HEAD(final String uri, final NVPair[] queryData); final HTTPResponse HEAD(final String uri,
                                 final NVPair[] queryData,
                                 NVPair[] headers); final HTTPResponse OPTIONS(); final HTTPResponse OPTIONS(String uri); final HTTPResponse OPTIONS(final String uri, final byte[] data); final HTTPResponse OPTIONS(final String uri,
                                    final byte[] data,
                                    NVPair[] headers); final HTTPResponse OPTIONS(String uri, InputStream inputStream); final HTTPResponse OPTIONS(final String uri,
                                    final InputStream inputStream,
                                    NVPair[] headers); final HTTPResponse POST(); final HTTPResponse POST(String uri); final HTTPResponse POST(NVPair[] formData); final HTTPResponse POST(String uri, NVPair[] formData); final HTTPResponse POST(final String uri,
                                 final NVPair[] formData,
                                 NVPair[] headers); final HTTPResponse POST(final String uri,
                                 final NVPair[] formData,
                                 NVPair[] headers,
                                 boolean isMultipart); final HTTPResponse POST(String uri, byte[] data); final HTTPResponse POST(final String uri,
                                 final byte[] data,
                                 NVPair[] headers); final HTTPResponse POST(String uri, InputStream inputStream); final HTTPResponse POST(final String uri,
                                 final InputStream inputStream,
                                 NVPair[] headers); final HTTPResponse PUT(); final HTTPResponse PUT(String uri); final HTTPResponse PUT(String uri, byte[] data); final HTTPResponse PUT(final String uri,
                                final byte[] data,
                                NVPair[] headers); final HTTPResponse PUT(String uri, InputStream inputStream); final HTTPResponse PUT(final String uri,
                                final InputStream inputStream,
                                NVPair[] headers); final HTTPResponse PATCH(); final HTTPResponse PATCH(String uri); final HTTPResponse PATCH(String uri, byte[] data); final HTTPResponse PATCH(final String uri,
                                final byte[] data,
                                NVPair[] headers); final HTTPResponse PATCH(String uri, InputStream inputStream); final HTTPResponse PATCH(final String uri,
                                final InputStream inputStream,
                                NVPair[] headers); final HTTPResponse TRACE(); final HTTPResponse TRACE(String uri); final HTTPResponse TRACE(final String uri, NVPair[] headers); static Test.InstrumentationFilter getHttpMethodFilter();  }### Answer:
@Test public void testSetUrl() throws Exception { final HTTPRequest httpRequest = new HTTPRequest(); assertNull(httpRequest.getUrl()); try { httpRequest.setUrl("foo/bah"); fail("Expected URLException"); } catch (final URLException e) { } assertNull(httpRequest.getUrl()); try { httpRequest.setUrl("http: fail("Expected ParseException"); } catch (final ParseException e) { } assertNull(httpRequest.getUrl()); httpRequest.setUrl("http: assertEquals("http: }