void (@NotNull Project project, @NotNull PsiElement startElement, @NotNull ModPsiUpdater updater) { final PsiNewExpression expression = (PsiNewExpression)startElement.getParent(); CommentTracker commentTracker = new CommentTracker(); final String newExpression = calculateReplacementExpression(expression, commentTracker); if (newExpression == null) return; final PsiMethodCallExpression methodCallExpression = PsiTreeUtil.getParentOfType(expression, PsiMethodCallExpression.class); if (methodCallExpression == null) return; PsiReplacementUtil.replaceExpression(methodCallExpression, newExpression, commentTracker); }