@Test
    void testDupSupport_unsortedValues() {
        BasicLmdbDb<UnSortedDupKey<String>, String> db = new BasicLmdbDb<>(
                lmdbEnv,
                new ByteBufferPoolFactory().getByteBufferPool(),
                new UnSortedDupKeySerde<>(new StringSerde()),
                new StringSerde(),
                "dupDb",
                DbiFlags.MDB_CREATE);

        final UnsortedDupKeyFactory<String> keyFactory = UnSortedDupKey.createFactory(String.class);
        lmdbEnv.doWithWriteTxn(writeTxn -> {
            // Three entries with the same key
            db.put(writeTxn, keyFactory.createUnsortedKey("key2"), "val2c", true);
            db.put(writeTxn, keyFactory.createUnsortedKey("key2"), "val2a", true);
            db.put(writeTxn, keyFactory.createUnsortedKey("key2"), "val2b", true);
            db.put(writeTxn, keyFactory.createUnsortedKey("key1"), "val1", true);
            // Two identical entries
            db.put(writeTxn, keyFactory.createUnsortedKey("key3"), "val3", true);
            db.put(writeTxn, keyFactory.createUnsortedKey("key3"), "val3", true);
        });

        db.logDatabaseContents();

        final List<Entry<UnSortedDupKey<String>, String>> entries = lmdbEnv.getWithReadTxn(readTxn ->
                db.streamEntries(readTxn, KeyRange.all(), stream -> stream
                        .collect(Collectors.toList())));

        LOGGER.info("Entries:\n{}", AsciiTable.builder(entries)
                .withColumn(Column.of("key", Entry::getKey))
                .withColumn(Column.of("value", Entry::getValue))
                .build());

        assertThat(entries)
                .extracting(entry -> entry.getKey().getKey())
                .containsExactly("key1",
                        "key2",
                        "key2",
                        "key2",
                        "key3",
                        "key3");

        assertThat(entries)
                .extracting(Entry::getValue)
                .containsExactly("val1",
                        "val2c",
                        "val2a",
                        "val2b",
                        "val3",
                        "val3");
    }
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