void (@NotNull Project project, @NotNull PsiElement element, @NotNull ModPsiUpdater updater) { PsiElement parent = element.getParent(); if (parent != null) { PsiExpression newMethodExpression = JavaPsiFacade.getElementFactory(project) .createExpressionFromText(CommonClassNames.JAVA_UTIL_COMPARATOR + "." + (reverse ? "reverseOrder()" : "naturalOrder()"), parent); element.replace(newMethodExpression); JavaCodeStyleManager.getInstance(project).shortenClassReferences(parent); } }