@Test
public void indexRecordTypeAdded() {

    RecordMetaData metaData1 = RecordMetaData.build(TestRecords1Proto.getDescriptor());
    validateIndexMutation("new index adds record type that is not newer than old meta-data", metaData1, "MySimpleRecord$num_value_3_indexed", indexProto ->
            indexProto.toBuilder().addRecordType("MyOtherRecord").build()
    );
    // Add NewRecord as a record type to the existing meta-data and index and validate that this change is okay
    // because the new record type is newer the old meta-data version.
    RecordMetaData tempMetaData = addNewRecordType(metaData1);
    RecordMetaData metaData2 = replaceIndex(tempMetaData, "MySimpleRecord$num_value_3_indexed", indexProto ->
            indexProto.toBuilder().addRecordType("NewRecord").build());
    validator.validate(metaData1, metaData2); // valid if type and index change happen together
    assertInvalid("new index adds record type that is not newer than old meta-data", tempMetaData, metaData2);
}