@Test
public void getContentReturnsInputStreamThatResetsByteBufReaderIndexOnClose() throws IOException {

    // given
    ByteBuf byteBuf = spy(createDefaultTestByteBuf());
    ByteBufHttpEntity entity = new ByteBufHttpEntity(byteBuf, 0, null);
    InputStream inputStream = entity.getContent();
    // when
    inputStream.close();
    // then
    verify(byteBuf).readerIndex(eq(0));
}