void (@NotNull Project project, @NotNull ProblemDescriptor descriptor) { PsiElement element = descriptor.getPsiElement(); if (!(element instanceof PsiBinaryExpression binaryExpression)) return; PsiExpression lOperand = binaryExpression.getLOperand(); PsiExpression rOperand = binaryExpression.getROperand(); if (rOperand == null) return; CommentTracker commentTracker = new CommentTracker(); String lText = commentTracker.text(PsiUtil.skipParenthesizedExprUp(lOperand)); String rText = commentTracker.text(PsiUtil.skipParenthesizedExprUp(rOperand)); @NonNls String expString = (myNegated ? "!" : "") + lText + ".equals(" + rText + ')'; PsiReplacementUtil.replaceExpression(binaryExpression, expString, commentTracker); }