void (@NotNull Project project, @NotNull PsiElement element, @NotNull ModPsiUpdater updater) { if (!(element instanceof PsiBinaryExpression expression)) { return; } final PsiExpression lhs = PsiUtil.skipParenthesizedExprDown(expression.getLOperand()); final PsiExpression rhs = PsiUtil.skipParenthesizedExprDown(expression.getROperand()); CommentTracker commentTracker = new CommentTracker(); final String newExpressionText; if (lhs instanceof PsiMethodCallExpression) { final PsiMethodCallExpression callExpression = (PsiMethodCallExpression)lhs; newExpressionText = createContainsExpressionText(callExpression, false, expression.getOperationTokenType(), commentTracker); } else if (rhs instanceof PsiMethodCallExpression) { final PsiMethodCallExpression callExpression = (PsiMethodCallExpression)rhs; newExpressionText = createContainsExpressionText(callExpression, true, expression.getOperationTokenType(), commentTracker); } else { return; } PsiReplacementUtil.replaceExpression(expression, newExpressionText, commentTracker); }