@Test
public void testFromTupleWithConstantValue() throws Exception {

    KeySpace root = new KeySpace(
            new KeySpaceDirectory("root", KeyType.LONG, 1L)
                .addSubdirectory(new KeySpaceDirectory("dir1", KeyType.STRING, "a"))
                .addSubdirectory(new KeySpaceDirectory("dir2", KeyType.STRING, "b"))
                .addSubdirectory(new KeySpaceDirectory("dir3", KeyType.LONG)));
    final FDBDatabase database = FDBDatabaseFactory.instance().getDatabase();
    try (FDBRecordContext context = database.openContext()) {
        Tuple tuple = Tuple.from(1L, "a");
        assertEquals(tuple, root.resolveFromKey(context, tuple).toTuple());
        tuple = Tuple.from(1L, "b");
        assertEquals(tuple, root.resolveFromKey(context, tuple).toTuple());
        final Tuple badTuple1 = Tuple.from(1L, "c", "d");
        assertThrows(RecordCoreArgumentException.class, () -> root.resolveFromKey(context, badTuple1).toTuple(),
                "key_tuple", badTuple1,
                "key_tuple_pos", 1);
    }
}