@Test
void testUpdateForMissingKey() {

    byte[] metadata = Tuple.from("some-metadata").pack();
    try (FDBRecordContext context = database.openContext()) {
        StringInterningLayer interningLayer = new StringInterningLayer(testSubspace);
        interningLayer.updateMetadata(context, "a-missing-key", metadata).join();
        fail("should throw NoSuchElementException");
    } catch (CompletionException ex) {
        assertThat(ex.getCause(), is(instanceOf(NoSuchElementException.class)));
        assertThat(ex.getCause(), hasMessageContaining("updateMetadata must reference key that already exists"));
    }
}