void (@NotNull Project project, @NotNull PsiMethod myMethod, @NotNull PsiType myReturnType) { PsiTypeElement typeElement = PsiElementFactory.getInstance(project).createTypeElement(myReturnType); myMethod.addBefore(typeElement, myMethod.getNameIdentifier()); }