@Test
public void uniquenessConstraintChanged() {

    // Adding a uniqueness constraint should throw an error
    RecordMetaData metaData1 = RecordMetaData.build(TestRecords1Proto.getDescriptor());
    validateIndexMutation("index adds uniqueness constraint", metaData1, "MySimpleRecord$str_value_indexed", this::makeUnique);
    // Removing the uniqueness constraint is fine
    RecordMetaData metaData2 = replaceIndex(metaData1, "MySimpleRecord$str_value_indexed", this::makeUnique);
    RecordMetaData metaData3 = replaceIndex(metaData2, "MySimpleRecord$str_value_indexed", this::clearOptions);
    validator.validate(metaData2, metaData3);
    RecordMetaData metaData4 = replaceIndex(metaData2, "MySimpleRecord$str_value_indexed", indexProto -> changeOption(indexProto, IndexOptions.UNIQUE_OPTION, "false"));
    validator.validate(metaData2, metaData4);
}