### Question:
ReadOnlyByteBuf extends AbstractDerivedByteBuf { @Override public ByteBuf setBytes(int index, ByteBuf src, int srcIndex, int length) { throw new ReadOnlyBufferException(); } ReadOnlyByteBuf(ByteBuf buffer); @Override boolean isWritable(); @Override boolean isWritable(int numBytes); @Override ByteBuf unwrap(); @Override ByteBufAllocator alloc(); @Override ByteOrder order(); @Override boolean isDirect(); @Override boolean hasArray(); @Override byte[] array(); @Override int arrayOffset(); @Override boolean hasMemoryAddress(); @Override long memoryAddress(); @Override ByteBuf discardReadBytes(); @Override ByteBuf setBytes(int index, ByteBuf src, int srcIndex, int length); @Override ByteBuf setBytes(int index, byte[] src, int srcIndex, int length); @Override ByteBuf setBytes(int index, ByteBuffer src); @Override ByteBuf setByte(int index, int value); @Override ByteBuf setShort(int index, int value); @Override ByteBuf setMedium(int index, int value); @Override ByteBuf setInt(int index, int value); @Override ByteBuf setLong(int index, long value); @Override int setBytes(int index, InputStream in, int length); @Override int setBytes(int index, ScatteringByteChannel in, int length); @Override int getBytes(int index, GatheringByteChannel out, int length); @Override ByteBuf getBytes(int index, OutputStream out, int length); @Override ByteBuf getBytes(int index, byte[] dst, int dstIndex, int length); @Override ByteBuf getBytes(int index, ByteBuf dst, int dstIndex, int length); @Override ByteBuf getBytes(int index, ByteBuffer dst); @Override ByteBuf duplicate(); @Override ByteBuf copy(int index, int length); @Override ByteBuf slice(int index, int length); @Override byte getByte(int index); @Override short getShort(int index); @Override int getUnsignedMedium(int index); @Override int getInt(int index); @Override long getLong(int index); @Override int nioBufferCount(); @Override ByteBuffer nioBuffer(int index, int length); @Override ByteBuffer[] nioBuffers(int index, int length); @Override ByteBuffer internalNioBuffer(int index, int length); @Override int forEachByte(int index, int length, ByteBufProcessor processor); @Override int forEachByteDesc(int index, int length, ByteBufProcessor processor); @Override int capacity(); @Override ByteBuf capacity(int newCapacity);  }### Answer:
@Test(expected = UnsupportedOperationException.class) public void shouldRejectSetBytes1() throws IOException { unmodifiableBuffer(EMPTY_BUFFER).setBytes(0, (InputStream) null, 0); }
@Test(expected = UnsupportedOperationException.class) public void shouldRejectSetBytes2() throws IOException { unmodifiableBuffer(EMPTY_BUFFER).setBytes(0, (ScatteringByteChannel) null, 0); }
@Test(expected = UnsupportedOperationException.class) public void shouldRejectSetBytes3() { unmodifiableBuffer(EMPTY_BUFFER).setBytes(0, (byte[]) null, 0, 0); }
@Test(expected = UnsupportedOperationException.class) public void shouldRejectSetBytes4() { unmodifiableBuffer(EMPTY_BUFFER).setBytes(0, (ByteBuf) null, 0, 0); }
@Test(expected = UnsupportedOperationException.class) public void shouldRejectSetBytes5() { unmodifiableBuffer(EMPTY_BUFFER).setBytes(0, (ByteBuffer) null); }