private boolean isEqualsConstant(PsiExpression expression, PsiVariable variable) {
      if (!(expression instanceof PsiMethodCallExpression methodCallExpression)) {
        return false;
      }
      final PsiReferenceExpression methodExpression = methodCallExpression.getMethodExpression();
      final String methodName = methodExpression.getReferenceName();
      if (!HardcodedMethodConstants.EQUALS.equals(methodName) && !HardcodedMethodConstants.EQUALS_IGNORE_CASE.equals(methodName)) {
        return false;
      }
      if (!ExpressionUtils.isReferenceTo(methodExpression.getQualifierExpression(), variable)) {
        return false;
      }
      final PsiExpressionList argumentList = methodCallExpression.getArgumentList();
      final PsiExpression[] arguments = argumentList.getExpressions();
      if (arguments.length != 1) {
        return false;
      }
      final PsiExpression argument = arguments[0];
      if (PsiUtil.isConstantExpression(argument)) return true;
      return REPORT_NON_CONSTANT &&
             !VariableAccessUtils.variableIsUsed(variable, argument) &&
             !SideEffectChecker.mayHaveSideEffects(argument) &&
             !CommonDataflow.getDfType(argument).isSuperType(DfTypes.NULL);
    }
private boolean isEqualsConstant(PsiExpression expression, PsiVariable variable)