@Test
public void removeFormerIndex() {

    RecordMetaDataBuilder metaData1Builder = RecordMetaData.newBuilder().setRecords(TestRecords1Proto.getDescriptor());
    metaData1Builder.removeIndex("MySimpleRecord$str_value_indexed");
    RecordMetaData metaData1 = metaData1Builder.getRecordMetaData();
    RecordMetaData metaData2 = RecordMetaData.build(
            metaData1.toProto().toBuilder().setVersion(metaData1.getVersion() + 1).clearFormerIndexes().build()
    );
    assertInvalid("former index removed", metaData1, metaData2);
}