@Test
public void selfReferenceChanged() {

    // This is largely to test that messages which include themselves as nested types don't cause the validator to blow up
    final Descriptor selfReferenceUnion = TestSelfReferenceProto.RecordTypeUnion.getDescriptor();
    final Descriptor unspooledUnion = TestSelfReferenceUnspooledProto.RecordTypeUnion.getDescriptor();
    validator.validateUnion(selfReferenceUnion, unspooledUnion);
    assertInvalid("field removed", unspooledUnion, selfReferenceUnion);
    FileDescriptor updatedUnspooledFile = mutateFile(TestSelfReferenceUnspooledProto.getDescriptor(), fileBuilder ->
            fileBuilder.getMessageTypeBuilderList().forEach(message -> {
                if (message.getName().equals("Node")) {
                    message.removeField(0);
                }
            })
    );
    assertNull(updatedUnspooledFile.findMessageTypeByName("Node").findFieldByName("rec_no"));
    assertInvalid("field removed", TestSelfReferenceUnspooledProto.getDescriptor(), updatedUnspooledFile);
}