PsiClass (@NotNull PsiElementFactory factory, @NotNull PsiClass psiClass) { PsiClass recreated = factory.createClassFromText(A_CLASS, null); return (PsiClass)psiClass.replace(recreated.getInnerClasses()[0]); }