public void validateDocumentGraph(List<SDDocumentType> documents) {
        for (SDDocumentType document : documents) {
            validateRoot(document);
        }
    }
@Test
    void self_reference_is_forbidden() {
        Throwable exception = assertThrows(DocumentGraphValidator.DocumentGraphException.class, () -> {
            Schema adSchema = createSearchWithName("ad");
            createDocumentReference(adSchema, adSchema, "ad_ref");

            DocumentGraphValidator validator = new DocumentGraphValidator();
            validator.validateDocumentGraph(documentListOf(adSchema));
        });
        assertTrue(exception.getMessage().contains("Document dependency cycle detected: ad->ad."));
    }