public void enumerateImportedFields(SDDocumentType documentType) {
        var search = this.schemas.stream()
                                 .filter(s -> s.getDocument() != null)
                                 .filter(s -> s.getDocument().getName().equals(documentType.getName()))
                                 .findFirst();
        if (search.isEmpty()) {
            return; // No imported fields present.
        }
        search.get().temporaryImportedFields().ifPresent(documentType::setTemporaryImportedFields);
    }
@Test
    void imported_fields_are_enumerated_and_copied_from_correct_search_instance() {
        String PARENT = "parent";
        Schema parentSchema = new Schema(PARENT, MockApplicationPackage.createEmpty());
        SDDocumentType parentDocument = new SDDocumentType(PARENT, parentSchema);
        var parentField = new SDField(parentDocument, "their_field", DataType.INT);
        AttributeUtils.addAttributeAspect(parentSchema.getName(), parentField);
        parentDocument.addField(parentField);
        parentSchema.addDocument(parentDocument);

        String FOO = "foo";
        Schema fooSchema = new Schema(FOO, MockApplicationPackage.createEmpty());
        /*
        SDField fooRefToParent = new SDField(
                "foo_ref", NewDocumentReferenceDataType.createWithInferredId(parentDocument.getDocumentType()));
        AttributeUtils.addAttributeAspect(fooRefToParent);
        */
        var fooImports = fooSchema.temporaryImportedFields().get();
        fooImports.add(new TemporaryImportedField("my_first_import", "foo_ref", "their_field"));
        fooImports.add(new TemporaryImportedField("my_second_import", "foo_ref", "their_field"));
        SDDocumentType fooDocument = new SDDocumentType(FOO, fooSchema);
        fooSchema.addDocument(fooDocument);

        String BAR = "bar";
        Schema barSchema = new Schema(BAR, MockApplicationPackage.createEmpty());
        /*
        SDField barRefToParent = new SDField(
                "bar_ref", NewDocumentReferenceDataType.createWithInferredId(parentDocument.getDocumentType()));
        AttributeUtils.addAttributeAspect(barRefToParent);
        */
        var barImports = barSchema.temporaryImportedFields().get();
        barImports.add(new TemporaryImportedField("my_cool_import", "my_ref", "their_field"));
        SDDocumentType barDocument = new SDDocumentType(BAR, barSchema);
        barSchema.addDocument(barDocument);

        var enumerator = new ImportedFieldsEnumerator(List.of(parentSchema, fooSchema, barSchema));

        enumerator.enumerateImportedFields(parentDocument);
        assertImportedFieldsAre(parentDocument, List.of()); // No imported fields in parent

        enumerator.enumerateImportedFields(fooDocument);
        assertImportedFieldsAre(fooDocument, List.of("my_first_import", "my_second_import"));

        enumerator.enumerateImportedFields(barDocument);
        assertImportedFieldsAre(barDocument, List.of("my_cool_import"));
    }