@NotNull
  public static List<PsiType> getExpectedTypeArguments(PsiElement context,
                                                       PsiClass aClass,
                                                       @NotNull Iterable<? extends PsiTypeParameter> typeParams,
                                                       @NotNull PsiClassType expectedType) {
    PsiClassType.ClassResolveResult resolve = expectedType.resolveGenerics();
    PsiClass expectedClass = resolve.getElement();

    if (!InheritanceUtil.isInheritorOrSelf(aClass, expectedClass, true)) {
      return ContainerUtil.map(typeParams, p -> (PsiType)null);
    }

    PsiSubstitutor substitutor = TypeConversionUtil.getClassSubstitutor(expectedClass, aClass, PsiSubstitutor.EMPTY);
    assert substitutor != null;

    return ContainerUtil.map(typeParams, p -> getExpectedTypeArg(context, resolve, substitutor, p));
  }
@NotNull
  public static List<PsiType> getExpectedTypeArguments(PsiElement context,
                                                       PsiClass aClass,
                                                       @NotNull Iterable<? extends PsiTypeParameter> typeParams,
                                                       @NotNull PsiClassType expectedType)