@Test(expected = NullPointerException.class)
public void testWriteToNull() throws Exception {

    final InputStreamEntity entity = new InputStreamEntity(EmptyInputStream.INSTANCE, 0, null);
    entity.writeTo(null);
}