private Map<UID, MapDefinition> loadEntries(List<MapDefinition> mapDefinitions) {
        List<UID> uids = new ArrayList<>();

        Map<UID, MapDefinition> loadedEntries = new HashMap<>();
        lmdbEnv.doWithWriteTxn(writeTxn -> {
            mapDefinitions.stream()
                    .forEach(mapDefinition -> {
                        final UID uid = mapDefinitionUIDStore.getOrCreateUid(
                                writeTxn,
                                mapDefinition,
                                mapDefinitionUIDStore.getUidPooledByteBuffer());
                        assertThat(uid).isNotNull();

                        // we are going to leave the txn so need to clone the UIDs
                        loadedEntries.put(uid.cloneToNewBuffer(), mapDefinition);
                    });
        });

        // make sure we each mapDefinition has resulted in a unique UID
        assertThat(loadedEntries).hasSize(mapDefinitions.size());
        assertThat(mapDefinitionUIDStore.getEntryCount()).isEqualTo(mapDefinitions.size());

        mapUidForwardDb.logDatabaseContents();
        mapUidReverseDb.logDatabaseContents();

        mapUidForwardDb.logRawDatabaseContents();
        mapUidReverseDb.logRawDatabaseContents();

        // now verify all the uid<->mapDef mappings we are about to return
        lmdbEnv.doWithReadTxn(readTxn -> {
            loadedEntries.forEach(((uid, mapDefinition) -> {
                UID uid2 = mapUidForwardDb.get(readTxn, mapDefinition).get();

                assertThat(uid.getBackingBuffer()).isEqualTo(uid2.getBackingBuffer());

                MapDefinition mapDefinition2 = mapUidReverseDb.get(readTxn, uid).get();

                assertThat(mapDefinition2).isEqualTo(mapDefinition);
            }));
        });

        return loadedEntries;
    }
Noddy test to verify how LMDB copes with different buffer capacities
stroom-pipeline/src/test/java/stroom/pipeline/refdata/store/offheapstore/TestMapDefinitionUIDStore.java