@Contract("null, _, _, _ -> null")
  @Nullable
  public static PsiType substituteTypeParameter(@Nullable PsiType psiType, @NotNull String superClass, int typeParamIndex, boolean eraseTypeParameter) {
    PsiClassType.ClassResolveResult classResolveResult = resolveClass(psiType);
    PsiClass psiClass = classResolveResult.getElement();
    if (psiClass == null) return null;

    PsiClass baseClass = JavaPsiFacade.getInstance(psiClass.getProject()).findClass(superClass, psiClass.getResolveScope());
    if (baseClass == null) return null;

    return substituteType(typeParamIndex, eraseTypeParameter, classResolveResult, psiClass, baseClass);
  }
@Contract("null, _, _, _ -> null")
  @Nullable
  public static PsiType substituteTypeParameter(@Nullable PsiType psiType, @NotNull String superClass, int typeParamIndex, boolean eraseTypeParameter)