PsiMethod (@NotNull String name) { PsiJavaFile aFile = createDummyJavaFile("class " + name + " { public " + name + "() {} }"); PsiMethod method = aFile.getClasses()[0].getMethods()[0]; return (PsiMethod)CodeStyleManager.getInstance(myManager.getProject()).reformat(method); }