private void doGetNextMapDefinitionTest(final Txn<ByteBuffer> writeTxn,
                                            final RefStreamDefinition inputRefStreamDefinition,
                                            final Optional<MapDefinition> optExpectedMapDefinition,
                                            final boolean deletePairAfterwards) {

        Optional<UID> optMapUid = mapDefinitionUIDStore.getNextMapDefinition(
                writeTxn, inputRefStreamDefinition, () -> ByteBuffer.allocateDirect(UID.UID_ARRAY_LENGTH));

        assertThat(optMapUid.isPresent()).isEqualTo(optExpectedMapDefinition.isPresent());

        if (optMapUid.isPresent()) {

            MapDefinition actualMapDefinition = mapUidReverseDb.get(writeTxn, optMapUid.get()).get();

            assertThat(actualMapDefinition).isEqualTo(optExpectedMapDefinition.get());

            if (deletePairAfterwards) {
                mapDefinitionUIDStore.deletePair(writeTxn, optMapUid.get());
            }
        }
    }
Noddy test to verify how LMDB copes with different buffer capacities
stroom-pipeline/src/test/java/stroom/pipeline/refdata/store/offheapstore/TestMapDefinitionUIDStore.java