private static NewDocumentType createDocumentTypeWithReferenceField(String nameReferencedDocumentType) {
        StructDataType headerfields = new StructDataType("headerfields");
        headerfields.addField(new Field("ref", new NewDocumentReferenceDataType(new DocumentType(nameReferencedDocumentType))));
        return new NewDocumentType(
                new NewDocumentType.Name("mydoc"),
                headerfields,
                new FieldSets(Optional.empty()),
                Set.of(),
                Set.of());
    }
Test validation of changes between a current and next document type used in a document database.

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