@Test
public void shouldEncodeLengthAsHex() {

    ByteArrayOutputStream out = new ByteArrayOutputStream(ONE_KILO);
    ChunkedPrintWriter printWriter = new ChunkedPrintWriter(out);
    printWriter.print("SomeTextLongerThanSixteenCharacters");
    printWriter.flush();
    assertThat(new String(out.toByteArray()), is("23\r\nSomeTextLongerThanSixteenCharacters\r\n"));
    printWriter.writeEnd();
    printWriter.flush();
    assertThat(new String(out.toByteArray()), is("23\r\nSomeTextLongerThanSixteenCharacters\r\n0\r\n\r\n"));
}