@Override
    public ByteBuf retainedSlice() {
        throw reject();
    }
@Test
    void testRetainedSlice() {
        ByteBuf buf = Unpooled.buffer(10);
        int i = 0;
        while (buf.isWritable()) {
            buf.writeByte(i++);
        }
        ReplayingDecoderByteBuf buffer = new ReplayingDecoderByteBuf(buf);
        ByteBuf slice = buffer.retainedSlice(0, 4);
        assertEquals(2, slice.refCnt());

        i = 0;
        while (slice.isReadable()) {
            assertEquals(i++, slice.readByte());
        }
        slice.release();
        buf.release();
        assertEquals(0, slice.refCnt());
        assertEquals(0, buf.refCnt());
        assertEquals(0, buffer.refCnt());
    }