### Question:
ByteBufHttpEntity extends AbstractHttpEntity { @Override public long getContentLength() { return this.length; } 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 setsContentLength() { long expectedContentLength = new Random().nextInt(1000); ByteBufHttpEntity entity = new ByteBufHttpEntity(createDefaultTestByteBuf(), expectedContentLength, null); long contentLength = entity.getContentLength(); assertEquals(expectedContentLength, contentLength); }