@Test
void testRelease() throws IOException {

    ByteBufferPool byteBufferPool = getByteBufferPool();
    assertThat(byteBufferPool.getCurrentPoolSize()).isEqualTo(0);
    PooledByteBufferOutputStream pooledByteBufferOutputStream = new PooledByteBufferOutputStream(
            byteBufferPool,
            2);
    pooledByteBufferOutputStream.write(new byte[]{0, 0});
    // release the PooledBuffer first
    pooledByteBufferOutputStream.getPooledByteBuffer().release();
    assertThat(byteBufferPool.getCurrentPoolSize()).isEqualTo(1);
    // now release the output stream
    pooledByteBufferOutputStream.release();
    assertThat(byteBufferPool.getCurrentPoolSize()).isEqualTo(1);
}