boolean (@Nullable PsiExpression expression, @Nullable PsiClass psiClass) { if (!(expression instanceof PsiThisExpression thisExpression)) { return false; } final PsiJavaCodeReferenceElement qualifier = thisExpression.getQualifier(); return qualifier == null || psiClass != null && qualifier.isReferenceTo(psiClass); }