### Question:
ByteBufHttpEntity extends AbstractHttpEntity { @Override public void writeTo(final OutputStream outstream) { throw new UnsupportedOperationException("writeTo(OutputStream) is not supported. Use getContent() to get InputStream instead"); } 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 writeToOutputStreamIsNotSupported() { ByteBufHttpEntity entity = new ByteBufHttpEntity(createDefaultTestByteBuf(), 0, null); expectedException.expect(UnsupportedOperationException.class); entity.writeTo(new ByteArrayOutputStream()); }