void (@NotNull Project project, @NotNull PsiElement element, @NotNull ReflectiveSignature signature) { final String replacementText = getMethodTypeExpressionText(signature); final PsiElementFactory factory = JavaPsiFacade.getElementFactory(project); final PsiExpression replacement = factory.createExpressionFromText(replacementText, element); final JavaCodeStyleManager styleManager = JavaCodeStyleManager.getInstance(project); styleManager.shortenClassReferences(element.replace(replacement)); }