@Test
    void self_inheritance_forbidden() {
        try {
            Schema adSchema = createSearchWithName("ad");
            SDDocumentType document = adSchema.getDocument();
            document.inherit(document);
            fail("Expected exception");
        }
        catch (IllegalArgumentException e) {
            assertEquals("Document type 'ad' cannot inherit itself", e.getMessage());
        }
    }
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