void (@NotNull Project project, @NotNull PsiElement element, @NotNull ModPsiUpdater updater) { final PsiElement parent = element.getParent(); if (!(parent instanceof PsiPrefixExpression prefixExpression)) { return; } if (!JavaTokenType.EXCL.equals(prefixExpression.getOperationTokenType())) { return; } final PsiExpression operand = PsiUtil.skipParenthesizedExprDown(prefixExpression.getOperand()); if (!(operand instanceof PsiBinaryExpression binaryExpression)) { return; } final IElementType tokenType = binaryExpression.getOperationTokenType(); CommentTracker commentTracker = new CommentTracker(); StringBuilder text = new StringBuilder(commentTracker.text(binaryExpression.getLOperand())); if (JavaTokenType.EQEQ.equals(tokenType)) { text.append("!="); } else if (JavaTokenType.NE.equals(tokenType)) { text.append("=="); } else { return; } final PsiExpression rhs = binaryExpression.getROperand(); if (rhs != null) { text.append(commentTracker.text(rhs)); } PsiReplacementUtil.replaceExpression(prefixExpression, text.toString(), commentTracker); }