void (@NotNull ActionContext context, @NotNull PsiBinaryExpression element, @NotNull ModPsiUpdater updater) { final CompareToResult compareToResult = CompareToResult.findCompareTo(element); assert compareToResult != null; final PsiExpression qualifier = compareToResult.getQualifier(); final PsiExpression argument = compareToResult.getArgument(); final StringBuilder text = new StringBuilder(); if (!compareToResult.isEqEq()) { text.append('!'); } if (qualifier != null) { text.append(qualifier.getText()).append('.'); } text.append("equals(").append(argument.getText()).append(')'); final PsiExpression newExpression = JavaPsiFacade.getElementFactory(context.project()).createExpressionFromText(text.toString(), null); final PsiElement result = compareToResult.getBinaryExpression().replace(newExpression); updater.moveTo(result.getTextOffset() + result.getTextLength()); }