boolean (@Nullable PsiExpression qualifierExpression, @NotNull PsiClass aClass) { if (qualifierExpression == null) return true; if (!(qualifierExpression instanceof PsiQualifiedExpression expression)) return false; PsiJavaCodeReferenceElement qualifier = expression.getQualifier(); if (qualifier == null) return true; PsiElement resolved = qualifier.resolve(); return resolved instanceof PsiClass && InheritanceUtil.isInheritorOrSelf(aClass, (PsiClass)resolved, true); }