### Question:
ByteBufHttpEntity extends AbstractHttpEntity { @Override public InputStream getContent() { return new ByteBufInputStream(this.content) { @Override public void close() throws IOException { super.close(); content.readerIndex(0); } }; } ByteBufHttpEntity(ByteBuf byteBuf, long length, ContentType contentType); @Override boolean isRepeatable(); @Override boolean isStreaming(); @Override long getContentLength(); @Override InputStream getContent(); @Override void writeTo(final OutputStream outstream);  }### Answer:
@Test public void getContentReturnsInputStreamThatResetsByteBufReaderIndexOnClose() throws IOException { ByteBuf byteBuf = spy(createDefaultTestByteBuf()); ByteBufHttpEntity entity = new ByteBufHttpEntity(byteBuf, 0, null); InputStream inputStream = entity.getContent(); inputStream.close(); verify(byteBuf).readerIndex(eq(0)); }