List<PsiType> (@NotNull PsiType selectorType) { List<PsiType> selectorTypes = new ArrayList<>(); PsiClass resolvedClass = PsiUtil.resolveClassInClassTypeOnly(selectorType); //T is an intersection type T1& ... &Tn and P covers Ti, for one of the types Ti (1≤i≤n) if (resolvedClass instanceof PsiTypeParameter typeParameter) { PsiClassType[] types = typeParameter.getExtendsListTypes(); Arrays.stream(types) .filter(t -> t != null) .forEach(t -> selectorTypes.add(t)); } if (selectorTypes.isEmpty()) { selectorTypes.add(selectorType); } return selectorTypes; }