public boolean isSubCategoryOf(TypeCategory ancestor) {
        if (this == ancestor) {
            return true;
        } else if (superType == null) {
            return false;
        } else {
            return superType == ancestor || superType.isSubCategoryOf(ancestor);
        }
    }
transitive and reflexive subCategoryOf check

@param ancestor
@return
querydsl-codegen-utils/src/main/java/com/querydsl/codegen/utils/model/TypeCategory.java