@Test
public void fieldIsType() {

    final DescriptorProtos.FileDescriptorProto file = TestRecords1Proto.getDescriptor().toProto();
    assertEquals(FieldTypeMatch.MATCHES,
            fieldIsType(file, RecordMetaDataBuilder.DEFAULT_UNION_NAME, "_MySimpleRecord", "MySimpleRecord"));
    assertEquals(FieldTypeMatch.MATCHES,
            fieldIsType(file, RecordMetaDataBuilder.DEFAULT_UNION_NAME, "_MySimpleRecord", ".com.apple.foundationdb.record.test1.MySimpleRecord"));
    assertEquals(FieldTypeMatch.MATCHES_AS_NESTED,
            fieldIsType(file, RecordMetaDataBuilder.DEFAULT_UNION_NAME, "_MySimpleRecord", ".com.apple.foundationdb.record"));
    assertEquals(FieldTypeMatch.DOES_NOT_MATCH,
            fieldIsType(file, RecordMetaDataBuilder.DEFAULT_UNION_NAME, "_MySimpleRecord", "MySimpleRecord.MyNestedRecord"));
    assertEquals(FieldTypeMatch.DOES_NOT_MATCH,
            fieldIsType(file, RecordMetaDataBuilder.DEFAULT_UNION_NAME, "_MySimpleRecord", ".com.apple.foundationdb.record.test1.MySimpleRecord.MyNestedRecord"));
    assertEquals(FieldTypeMatch.DOES_NOT_MATCH,
            fieldIsType(file, RecordMetaDataBuilder.DEFAULT_UNION_NAME, "_MySimpleRecord", ".com.apple.foundationdb.record.test2.MySimpleRecord"));
    assertEquals(FieldTypeMatch.DOES_NOT_MATCH,
            fieldIsType(file, RecordMetaDataBuilder.DEFAULT_UNION_NAME, "_MySimpleRecord", "MyOtherRecord"));
}