void (@NotNull Project project, @NotNull PsiElement element, @NotNull ModPsiUpdater updater) { if (element instanceof PsiExpression expr && BoolUtils.isNegation(expr)) { element = BoolUtils.getNegated(expr); } final PsiMethodCallExpression call = PsiTreeUtil.getParentOfType(element, PsiMethodCallExpression.class, false); EqualityCheck check = EqualityCheck.from(call); if (check == null) return; PsiExpression lhs = check.getLeft(); PsiExpression rhs = check.getRight(); final PsiElement parent = ParenthesesUtils.getParentSkipParentheses(call); final CommentTracker commentTracker = new CommentTracker(); final String lhsText = commentTracker.text(lhs, ParenthesesUtils.EQUALITY_PRECEDENCE); final String rhsText = commentTracker.text(rhs, ParenthesesUtils.EQUALITY_PRECEDENCE); if (parent instanceof PsiExpression && BoolUtils.isNegation((PsiExpression)parent)) { PsiReplacementUtil.replaceExpression((PsiExpression)parent, lhsText + "!=" + rhsText, commentTracker); } else { PsiReplacementUtil.replaceExpression(call, lhsText + "==" + rhsText, commentTracker); } }