@Test
    void getOrCreateId_multiple() {

        int putCount = 5;
        String uuidStr = UUID.randomUUID().toString();
        final List<MapDefinition> mapDefinitions = IntStream.rangeClosed(1, putCount)
                .boxed()
                .map(i -> {
                    String versionUuid = UUID.randomUUID().toString();
                    // each one is different by the streamId
                    final RefStreamDefinition refStreamDefinition = new RefStreamDefinition(
                            uuidStr,
                            versionUuid,
                            i);
                    return new MapDefinition(refStreamDefinition, "MyMapName");

                })
                .toList();

        final Map<UID, MapDefinition> loadedEntries = loadEntries(mapDefinitions);

        assertThat(loadedEntries).hasSize(mapDefinitions.size());

        final List<Long> values = loadedEntries.entrySet().stream()
                .map(Map.Entry::getKey)
                .map(UID::getValue)
                .sorted()
                .toList();

        // convert the UIDs back to values and check we have all we expect
        assertThat(values)
                .containsExactly(LongStream
                        .range(0, putCount)
                        .boxed()
                        .toArray(Long[]::new));

        // now try and call get() for each mapDefinition and check it gives us the right UID

        try (PooledByteBuffer uidPooledBuffer = mapDefinitionUIDStore.getUidPooledByteBuffer()) {
            loadedEntries.entrySet().forEach(entry -> {
                UID uidLoaded = entry.getKey();
                MapDefinition mapDefinitionLoaded = entry.getValue();
                UID uidFromGet = mapDefinitionUIDStore.getUid(mapDefinitionLoaded, uidPooledBuffer.getByteBuffer())
                        .orElseGet(() -> {
                            fail("Expecting to get a value back but didn't");
                            return null;
                        });
                assertThat(uidFromGet).isEqualTo(uidLoaded);
            });
        }
    }
Noddy test to verify how LMDB copes with different buffer capacities
stroom-pipeline/src/test/java/stroom/pipeline/refdata/store/offheapstore/TestMapDefinitionUIDStore.java