private static Schema createSearchWithName(String name, Schema... parents) {
        Schema campaignSchema = new Schema(name, MockApplicationPackage.createEmpty());
        SDDocumentType document = new SDDocumentType(name);
        campaignSchema.addDocument(document);
        document.setDocumentReferences(new DocumentReferences(Map.of()));
        Arrays.stream(parents)
                .map(Schema::getDocument)
                .forEach(document::inherit);
        return campaignSchema;
    }
Self inheritance is checked early because it is possible, and because it otherwise
produces a stack overflow before getting to graph validation.
config-model/src/test/java/com/yahoo/schema/DocumentGraphValidatorTest.java