@Test
public void write() throws Exception {

    String content = "Hello, World.";
    byte[] rawBytes = content.getBytes("utf-8");
    ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
    HttpClient httpClient = new HttpClient();
    httpClient.write(outputStream, rawBytes);
    assertThat(outputStream.toByteArray(), is(rawBytes));
}