void (@NotNull Project project, @NotNull PsiElement element, @NotNull ModPsiUpdater updater) { final PsiElement parent = element.getParent(); final PsiMethodCallExpression methodCallExpression = (PsiMethodCallExpression)parent.getParent(); PsiExpression qualifierExpression = methodCallExpression.getMethodExpression().getQualifierExpression(); if (qualifierExpression == null) { return; } CommentTracker tracker = new CommentTracker(); tracker.markUnchanged(qualifierExpression); final String newExpressionText = qualifierExpression.getText() + ".remove()"; PsiReplacementUtil.replaceExpression(methodCallExpression, newExpressionText, tracker); }