@Test public void testBasics() throws Exception { final byte[] bytes = "Message content".getBytes(StandardCharsets.US_ASCII); final InputStream content = new ByteArrayInputStream(bytes); final BasicHttpEntity httpentity = new BasicHttpEntity(); httpentity.setContent(content); httpentity.setContentLength(bytes.length); Assert.assertEquals(bytes.length, httpentity.getContentLength()); Assert.assertFalse(httpentity.isRepeatable()); Assert.assertTrue(httpentity.isStreaming()); }