HttpEntityWrapper implements HttpEntity { @Override public void writeTo(OutputStream outstream) throws IOException { writable.write(outstream); } HttpEntityWrapper(Writable writable); @Override boolean isRepeatable(); @Override boolean isChunked(); @Override long getContentLength(); @Override Header getContentType(); @Override Header getContentEncoding(); @Override InputStream getContent(); @Override void writeTo(OutputStream outstream); @Override boolean isStreaming(); @Override void consumeContent();  }
@Test public void shouldCallWriteMethod() throws IOException { Writable writable = mock(Writable.class); HttpEntityWrapper wrapper = given(writable); OutputStream out = mock(OutputStream.class); wrapper.writeTo(out); verify(writable).write(out); }