### Question:
PacketReceiver implements Closeable { @Override public void close() { returnPacketBufToPool(); } PacketReceiver(boolean useDirectBuffers); PacketHeader getHeader(); ByteBuffer getDataSlice(); ByteBuffer getChecksumSlice(); void receiveNextPacket(ReadableByteChannel in); void receiveNextPacket(InputStream in); void mirrorPacketTo(DataOutputStream mirrorOut); @Override // Closeable void close();  }### Answer:
@Test public void testReceiveAndMirror() throws IOException { PacketReceiver pr = new PacketReceiver(false); doTestReceiveAndMirror(pr, 100, 10); doTestReceiveAndMirror(pr, 50, 10); doTestReceiveAndMirror(pr, 150, 10); pr.close(); }