@Test
public void testIndexKeyTooLarge() {

    assertThrows(FDBExceptions.FDBStoreKeySizeException.class, () -> {
        try (FDBRecordContext context = openContext()) {
            openSimpleRecordStore(context);
            TestRecords1Proto.MySimpleRecord.Builder recBuilder = TestRecords1Proto.MySimpleRecord.newBuilder();
            recBuilder.setRecNo(1);
            recBuilder.setStrValueIndexed(Strings.repeat("x", 10000));
            recordStore.saveRecord(recBuilder.build());
            fail("exception should have been thrown before commit");
            commit(context);
        }
    });
}