public List<VespaConfigChangeAction> validate() {
        return currentDocType.getAllFields().stream().
                map(field -> createFieldChange(field, nextDocType)).
                filter(fieldChange -> fieldChange.valid() && fieldChange.changedType()).
                map(fieldChange -> VespaRefeedAction.of(id,
                                                        ValidationId.fieldTypeChange,
                                                        new ChangeMessageBuilder(fieldChange.fieldName()).
                                                                                 addChange("data type", fieldChange.currentTypeName(),
                                                                                 fieldChange.nextTypeName()).build()
                )).
                collect(Collectors.toList());
    }
@Test
    void requireThatChangingTargetTypeOfReferenceFieldIsNotOK() {
        var validator = new DocumentTypeChangeValidator(ClusterSpec.Id.from("test"),
                createDocumentTypeWithReferenceField("oldDoc"),
                createDocumentTypeWithReferenceField("newDoc"));
        List<VespaConfigChangeAction> result = validator.validate();
        assertEquals(1, result.size());
        VespaConfigChangeAction action = result.get(0);
        assertTrue(action instanceof VespaRefeedAction);
        assertEquals(
                "type='refeed', " +
                        "message='Field 'ref' changed: data type: 'Reference<oldDoc>' -> 'Reference<newDoc>'', " +
                        "services=[], documentType=''",
                action.toString());
    }