NioPlainEngine implements NioFilter { @Override public ByteBuffer unwrap(ByteBuffer wrappedBuffer) { wrappedBuffer.position(wrappedBuffer.limit()); return wrappedBuffer; } NioPlainEngine(BufferPool bufferPool); @Override ByteBuffer wrap(ByteBuffer buffer); @Override ByteBuffer unwrap(ByteBuffer wrappedBuffer); @Override ByteBuffer ensureWrappedCapacity(int amount, ByteBuffer wrappedBuffer,
      BufferPool.BufferType bufferType); @Override ByteBuffer readAtLeast(SocketChannel channel, int bytes, ByteBuffer wrappedBuffer); void doneReading(ByteBuffer unwrappedBuffer); @Override ByteBuffer getUnwrappedBuffer(ByteBuffer wrappedBuffer);  }
@Test public void unwrap() { ByteBuffer buffer = ByteBuffer.allocate(100); buffer.position(0).limit(buffer.capacity()); nioEngine.unwrap(buffer); assertThat(buffer.position()).isEqualTo(buffer.limit()); }