PsiClass (@NotNull PsiElementFactory factory, @NotNull String className, @NotNull PsiMember member) { PsiMethod psiMethod = ObjectUtils.tryCast(member, PsiMethod.class); if (psiMethod == null || psiMethod.getBody() != null || psiMethod.hasModifier(JvmModifier.NATIVE)) { return factory.createClass(className); } if (psiMethod.hasModifier(JvmModifier.ABSTRACT)) { PsiClass psiClass = factory.createClass(className); Objects.requireNonNull(psiClass.getModifierList()).setModifierProperty(PsiModifier.ABSTRACT, true); return psiClass; } return factory.createInterface(className); }