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

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