PsiSubstitutor (final PsiType superClassType, final PsiClassType targetClassType, final PsiResolveHelper resolveHelper, PsiClass targetClass) { PsiSubstitutor subst = PsiSubstitutor.EMPTY; for (PsiTypeParameter typeParameter : PsiUtil.typeParametersIterable(targetClass)) { subst = subst.put(typeParameter, resolveHelper.getSubstitutionForTypeParameter(typeParameter, targetClassType, superClassType, false, PsiUtil.getLanguageLevel(targetClass))); } return subst; }