### Question:
UrlHttpClient implements HttpClient { void writeContentToConnection(HttpRequest request, HttpURLConnection connection) throws IOException { writeContentToConnection(request, connection, null ); } UrlHttpClient(ClientConfiguration config); @Override HttpResponse execute(final HttpRequest request); @Override void shutdown();  }### Answer:
@Test public void testWriteContentToConnection() throws URISyntaxException, IOException { final ByteArrayInputStream bais = new ByteArrayInputStream("Content".getBytes(StringUtils.UTF8)); final Map<String, String> headers = new HashMap<String, String>(); headers.put(HttpHeader.CONTENT_LENGTH, String.valueOf("Content".getBytes(StringUtils.UTF8).length)); final HttpRequest request = new HttpRequest("POST", new URI("https: bais); final MockHttpURLConnection connection = new MockHttpURLConnection( new URL("https: final ByteArrayOutputStream baos = new ByteArrayOutputStream(); connection.setOutputStream(baos); client.writeContentToConnection(request, connection); final ByteArrayOutputStream connOs = (ByteArrayOutputStream) connection.getOutputStream(); assertEquals(new String(connOs.toByteArray(), StringUtils.UTF8), "Content"); }