@Test(expected = ReadOnlyBufferException.class)
public void testSetBytesWithByteBuffer() {

    ByteBuf buf = newBuffer(wrappedBuffer(new byte[8]));
    try {
        buf.setBytes(0, ByteBuffer.wrap(new byte[4]));
    } finally {
        buf.release();
    }
}