PsiClass (@NotNull PsiDirectory psiRootDir, boolean isSubclass, @NotNull PsiElement contextElement) { Project project = psiRootDir.getProject(); PsiClass psiImplClass = createClassInRoot(myImplementationClassName, CreateClassKind.CLASS, psiRootDir, contextElement, isSubclass ? mySuperClassName : null); if (psiImplClass != null && !isSubclass) { String text = "public static " + mySuperClassName + " provider() { return null;}"; PsiMethod method = JavaPsiFacade.getElementFactory(project).createMethodFromText(text, psiImplClass.getLBrace()); method = (PsiMethod)psiImplClass.addAfter(method, psiImplClass.getLBrace()); JavaCodeStyleManager.getInstance(project).shortenClassReferences(method); } return psiImplClass; }