private TimedCase buildPutPerfTestCase(
            final String testName,
            final TriConsumer<Txn<ByteBuffer>, ByteBuffer, ByteBuffer> putFunc) {

        return TimedCase.of(testName, (round, iterations) -> {
            final int roundIdx = round - 1;
            try (final PooledByteBufferPair pooledBufferPair = basicLmdbDb.getPooledBufferPair()) {
                final long fromInc = iterations * roundIdx;
                final long toExc = iterations * (roundIdx + 1);
                lmdbEnv.doWithWriteTxn(writeTxn -> {
                    LongStream.range(fromInc, toExc)
                            .forEach(i -> {
                                final ByteBuffer keyBuff = pooledBufferPair.getKeyBuffer();
                                keyBuff.clear();
                                final ByteBuffer valBuff = pooledBufferPair.getValueBuffer();
                                valBuff.clear();
                                basicLmdbDb.serializeKey(
                                        keyBuff,
                                        "key-" + Strings.padStart(
                                                Long.toString(i), 10, '0'));
                                basicLmdbDb.serializeValue(
                                        valBuff,
                                        "val-" + Strings.padStart(
                                                Long.toString(i), 10, '0'));
                                // Do the put
                                putFunc.accept(writeTxn, keyBuff, valBuff);
                            });
                });
            }
        });
    }
This test is an example of how to abuse LMDB. If run it will crash the JVM
as a direct bytebuffer returned from a get() was mutated outside the transaction.
stroom-lmdb/src/test/java/stroom/lmdb/TestBasicLmdbDb.java