@Test
void testInterning() {

    final ResolverResult internedValue;
    try (FDBRecordContext context = database.openContext()) {
        StringInterningLayer interningLayer = new StringInterningLayer(testSubspace);
        internedValue = interningLayer.intern(context, "a-string").join();
        for (int i = 0; i < 5; i++) {
            ResolverResult currentCall = interningLayer.intern(context, "a-string").join();
            assertThat("we see the same interned value for subsequent calls in the transaction",
                    currentCall, is(internedValue));
        }
        context.commit();
    }
    try (FDBRecordContext context = database.openContext()) {
        StringInterningLayer interningLayer = new StringInterningLayer(testSubspace);
        for (int i = 0; i < 5; i++) {
            ResolverResult currentCall = interningLayer.intern(context, "a-string").join();
            assertThat("we see the same interned value for subsequent transactions", currentCall, is(internedValue));
        }
    }
}