List<PsiType> (PsiClass psiClass) { List<PsiType> superTypes = new ArrayList<>(); if (psiClass instanceof PsiAnonymousClass) { ContainerUtil.addIfNotNull(superTypes, ((PsiAnonymousClass)psiClass).getBaseClassType()); } Collections.addAll(superTypes, psiClass.getExtendsListTypes()); Collections.addAll(superTypes, psiClass.getImplementsListTypes()); return superTypes; }