private static boolean isReferenceTo(PsiExpression expression, PsiVariable variable) {
      return expression instanceof PsiReferenceExpression referenceExpression &&
             !referenceExpression.isQualified() && referenceExpression.resolve() == variable;
    }
private static boolean isReferenceTo(PsiExpression expression, PsiVariable variable)