@Override
    public <T> T getWithBuffer(final int minCapacity, Function<ByteBuffer, T> work) {
        ByteBuffer buffer = null;
        try {
            buffer = getBuffer(minCapacity);
            return work.apply(buffer);
        } finally {
            if (buffer != null) {
                release(buffer);
            }
        }
    }
Perform work with a {@link ByteBuffer} obtained from the pool. The {@link ByteBuffer}
must not be used outside of the work lambda.
stroom-bytebuffer/src/main/java/stroom/bytebuffer/ByteBufferPoolImpl3.java