Boolean (@NotNull PsiClassType classType) { PsiClassType.ClassResolveResult result = classType.resolveGenerics(); final PsiClass psiClass = result.getElement(); if (psiClass != null) { PsiSubstitutor substitutor = result.getSubstitutor(); for (PsiTypeParameter parameter : PsiUtil.typeParametersIterable(psiClass)) { PsiType type = substitutor.substitute(parameter); if (type != null && type.accept(this)) return true; } } return psiClass instanceof PsiTypeParameter && wantedTypeParameter.test((PsiTypeParameter)psiClass); }