private static FieldChange createFieldChange(Field currentField, NewDocumentType nextDocType) {
        Field nextField = nextDocType.getField(currentField.getName());
        if (nextField != null && areStructFields(currentField, nextField)) {
            return new StructFieldChange(currentField, nextField);
        }
        return new SimpleFieldChange(currentField, nextField);
    }
Validates the changes between a current and next document type used in a document database.

@author toregge
config-model/src/main/java/com/yahoo/vespa/model/application/validation/change/search/DocumentTypeChangeValidator.java