### Question:
UrlHttpClient implements HttpClient { HttpURLConnection applyHeadersAndMethod(final HttpRequest request, final HttpURLConnection connection) throws ProtocolException { return applyHeadersAndMethod(request, connection, null ); } UrlHttpClient(ClientConfiguration config); @Override HttpResponse execute(final HttpRequest request); @Override void shutdown();  }### Answer:
@Test public void testApplyHeaders() throws ProtocolException, MalformedURLException, URISyntaxException { final Map<String, String> headers = new HashMap<String, String>(); headers.put("testKey", "testValue"); headers.put(HttpHeader.CONTENT_LENGTH, "I should not be added"); headers.put(HttpHeader.HOST, "I should not be added"); final HttpRequest request = new HttpRequest("POST", new URI("https: null); final HttpsURLConnection conn = (HttpsURLConnection) client.applyHeadersAndMethod(request, new MockHttpURLConnection(new URL("https: assertEquals(conn.getRequestProperty("testKey"), "testValue"); assertNull(conn.getRequestProperty(HttpHeader.CONTENT_LENGTH)); assertNull(conn.getRequestProperty(HttpHeader.HOST)); assertEquals(conn.getRequestMethod(), "POST"); }