Collection<PsiClass> (@NotNull PsiType type, @NotNull Collection<PsiClass> candidates) { PsiClass actualClass = PsiUtil.resolveClassInClassTypeOnly(type); if (actualClass != null) { return ContainerUtil.findAll(candidates, psiClass -> InheritanceUtil.isInheritorOrSelf(actualClass, psiClass, true)); } return candidates; }