@Test
public void wrappedReadOnlyDirectBuffer() {

    ByteBuffer buffer = ByteBuffer.allocateDirect(12);
    for (int i = 0; i < 12; i++) {
        buffer.put((byte) i);
    }
    buffer.flip();
    ByteBuf wrapped = wrappedBuffer(buffer.asReadOnlyBuffer());
    for (int i = 0; i < 12; i++) {
        assertEquals((byte) i, wrapped.readByte());
    }
    wrapped.release();
}