private static void verifyReferredDocumentsAreGlobal(Map<String, NewDocumentType> documentDefinitions,
                                                         Set<NewDocumentType> globallyDistributedDocuments) {
        Set<NewDocumentType> nonGlobalReferencedDocuments = getReferencedDocuments(documentDefinitions)
                .map(name -> documentDefinitions.get(name.toString()))
                .filter(documentType -> !globallyDistributedDocuments.contains(documentType))
                .collect(Collectors.toCollection(() -> new LinkedHashSet<>()));
        if (!nonGlobalReferencedDocuments.isEmpty()) {
            throw new IllegalArgumentException("The following document types are referenced from other documents, " +
                    "but are not globally distributed: " + asPrintableString(toDocumentNameStream(nonGlobalReferencedDocuments)));
        }
    }
Performs the following validations:
 - Verify that all global documents have required redundancy
 - Verify that all referred documents are present in services.xml
 - Verify that all referred documents are global

@author bjorncs
config-model/src/main/java/com/yahoo/vespa/model/content/GlobalDistributionValidator.java