public void release() {
        if (isReleased()) {
            return;
        }
        released = true;
        // decrease ref count when buffer is released from memory.
        buffer.recycleBuffer();
    }
@Test
    void testBufferReleaseRepeatedly() {
        bufferContext.release();
        assertThatNoException()
                .as("repeatedly release should only recycle buffer once.")
                .isThrownBy(() -> bufferContext.release());
    }