PsiClass (@NotNull String name, @NotNull PsiClass outerClass, @Nullable String superClassName) { Project project = outerClass.getProject(); PsiClass psiClass = JavaPsiFacade.getElementFactory(project).createClass(name); psiClass = (PsiClass)outerClass.addBefore(psiClass, outerClass.getRBrace()); PsiUtil.setModifierProperty(psiClass, PsiModifier.STATIC, true); PsiUtil.setModifierProperty(psiClass, PsiModifier.PUBLIC, true); if (superClassName != null) { CreateFromUsageUtils.setupSuperClassReference(psiClass, superClassName); } return psiClass; }