void (@NotNull Project project, @NotNull PsiElement startElement, @NotNull ModPsiUpdater updater) { final PsiNewExpression expression = PsiTreeUtil.getParentOfType(startElement, PsiNewExpression.class, false); assert expression != null; final PsiExpressionList argList = expression.getArgumentList(); assert argList != null; final PsiExpression[] args = argList.getExpressions(); final PsiExpression arg = args[0]; CommentTracker commentTracker = new CommentTracker(); final String text = commentTracker.text(arg); PsiReplacementUtil.replaceExpression(expression, className + ".valueOf(" + text + ')', commentTracker); }