@Test
    void testSmallDbKey() {
        final Dbi<ByteBuffer> dbi = lmdbEnv.openDbi("testDb", DbiFlags.MDB_CREATE);
        String keyStr = "greeting";
        final ByteBuffer key = ByteBuffer.allocateDirect(keyStr.length());
        final ByteBuffer value = ByteBuffer.allocateDirect(20);
        key.put(keyStr.getBytes(StandardCharsets.UTF_8)).flip();
        value.put("Hello world".getBytes(StandardCharsets.UTF_8)).flip();

        LOGGER.debug("key {}", ByteBufferUtils.byteBufferInfo(key));
        LOGGER.debug("value {}", ByteBufferUtils.byteBufferInfo(value));

        lmdbEnv.doWithWriteTxn(writeTxn -> {
            long entryCount = LmdbUtils.getEntryCount(lmdbEnv, writeTxn, dbi);
            assertThat(entryCount).isEqualTo(0);
            dbi.put(writeTxn, key, value);
            entryCount = LmdbUtils.getEntryCount(lmdbEnv, writeTxn, dbi);
            assertThat(entryCount).isEqualTo(1);
        });

        final long entryCount = LmdbUtils.getEntryCount(lmdbEnv, dbi);
        assertThat(entryCount).isEqualTo(1);
        LmdbUtils.logRawDatabaseContents(lmdbEnv, dbi, LOGGER::info);

        final Long entries = lmdbEnv.getWithReadTxn(txn ->
                dbi.stat(txn).entries);

        assertThat(entries).isEqualTo(1);

        final ByteBuffer searchKey = ByteBuffer.allocateDirect(30);
        searchKey.put("greeting".getBytes(StandardCharsets.UTF_8)).flip();
        LOGGER.debug("searchKey {}", ByteBufferUtils.byteBufferInfo(searchKey));

        final ByteBuffer foundValue = lmdbEnv.getWithReadTxn(txn ->
                dbi.get(txn, searchKey));
        LOGGER.debug("foundValue {}", ByteBufferUtils.byteBufferInfo(foundValue));
    }
Noddy test to verify how LMDB copes with different buffer capacities
stroom-pipeline/src/test/java/stroom/pipeline/refdata/store/offheapstore/TestMapDefinitionUIDStore.java