void (@NotNull Project project, @NotNull PsiElement element, @NotNull ModPsiUpdater updater) { final PsiElement parent = element.getParent(); if (!(parent instanceof PsiBinaryExpression binaryExpression)) { return; } CommentTracker commentTracker = new CommentTracker(); final IElementType tokenType = binaryExpression.getOperationTokenType(); @NonNls final StringBuilder newExpressionText = new StringBuilder(); if (JavaTokenType.NE.equals(tokenType)) { newExpressionText.append('!'); } else if (!JavaTokenType.EQEQ.equals(tokenType)) { return; } if (deepEquals) { newExpressionText.append("java.util.Arrays.deepEquals("); } else { newExpressionText.append("java.util.Arrays.equals("); } newExpressionText.append(commentTracker.text(binaryExpression.getLOperand())); newExpressionText.append(','); final PsiExpression rhs = binaryExpression.getROperand(); if (rhs == null) { return; } newExpressionText.append(commentTracker.text(rhs)); newExpressionText.append(')'); PsiReplacementUtil.replaceExpressionAndShorten(binaryExpression, newExpressionText.toString(), commentTracker); }