public void validate(Map<String, NewDocumentType> documentDefinitions,
                         Set<NewDocumentType> globallyDistributedDocuments) {
        verifyReferredDocumentsArePresent(documentDefinitions);
        verifyReferredDocumentsAreGlobal(documentDefinitions, globallyDistributedDocuments);
    }
@Test
    void throws_exception_if_referenced_document_not_global() {
        NewDocumentType parent = createDocumentType("parent");
        Fixture fixture = new Fixture()
                .addNonGlobalDocument(parent)
                .addNonGlobalDocument(createDocumentType("child", parent));
        try {
            validate(fixture);
            fail();
        } catch (IllegalArgumentException e) {
            assertEquals("The following document types are referenced from other documents, but are not globally distributed: 'parent'",
                    e.getMessage());
        }
    }