### Question:
PartiallyRepeatableHttpEntity extends HttpEntityWrapper { @Override public long getContentLength() { return wrappedEntity.getContentLength(); } PartiallyRepeatableHttpEntity(final HttpEntity entity, int bufferSize);  PartiallyRepeatableHttpEntity(final HttpEntity entity); @Override boolean isRepeatable(); @Override boolean isStreaming(); @Override boolean isChunked(); @Override long getContentLength(); @Override InputStream getContent(); @Override void writeTo( final OutputStream stream ); @Override @SuppressWarnings( "deprecation" ) void consumeContent(); static final int DEFAULT_BUFFER_SIZE; }### Answer:
@Test public void testGetContentLength() throws Exception { String input = "0123456789"; BasicHttpEntity basic; PartiallyRepeatableHttpEntity replay; basic = new BasicHttpEntity(); basic.setContent( new ByteArrayInputStream( input.getBytes( StandardCharsets.UTF_8 ) ) ); replay = new PartiallyRepeatableHttpEntity( basic, 5 ); assertThat( replay.getContentLength(), is( -1L ) ); basic = new BasicHttpEntity(); basic.setContent( new ByteArrayInputStream( input.getBytes( StandardCharsets.UTF_8 ) ) ); basic.setContentLength( input.length() ); replay = new PartiallyRepeatableHttpEntity( basic, 5 ); assertThat( replay.getContentLength(), is( 10L ) ); }