boolean (@Nullable PsiType type, @NotNull PsiSubstitutor substitutor) { if (type instanceof PsiClassType) { final PsiClass returnClass = ((PsiClassType)type).resolve(); if (returnClass instanceof PsiTypeParameter typeParameter) { return substitutor.substitute(typeParameter) == null; } } return false; }