public Optional<Buffer> getBuffer() {
        return buffer != null ? Optional.of(buffer) : Optional.empty();
    }
@Test
    void testGetBuffer() {
        Buffer buffer = BufferBuilderTestUtils.buildSomeBuffer(0);
        NettyPayload nettyPayload = NettyPayload.newBuffer(buffer, 0, 0);
        assertThat(nettyPayload.getBuffer()).isPresent();
        assertThat(nettyPayload.getBuffer()).hasValue(buffer);
        assertThatThrownBy(() -> NettyPayload.newBuffer(null, 0, 0))
                .isInstanceOf(IllegalStateException.class);
        assertThatThrownBy(() -> NettyPayload.newBuffer(buffer, -1, 0))
                .isInstanceOf(IllegalStateException.class);
        assertThatThrownBy(() -> NettyPayload.newBuffer(buffer, 0, -1))
                .isInstanceOf(IllegalStateException.class);
    }