public static boolean bindsTypeParameters(PsiType t, Set<? extends PsiTypeParameter> params) {
    if (t instanceof PsiWildcardType wct) {
      final PsiType bound = wct.getBound();

      return bound != null && wct.isExtends() && bindsTypeParameters(bound, params);
    }

    final PsiClassType.ClassResolveResult result = resolveType(t);
    final PsiClass theClass = result.getElement();
    final PsiSubstitutor theSubst = result.getSubstitutor();

    if (theClass == null) {
      return false;
    }

    if (theClass instanceof PsiTypeParameter) {
      return params == null || params.contains(theClass);
    }
    else if (theClass.hasTypeParameters()) {
      for (PsiTypeParameter parameter : PsiUtil.typeParametersIterable(theClass)) {
        PsiType bound = theSubst.substitute(parameter);

        if (bound != null && bindsTypeParameters(bound, params)) {
          return true;
        }
      }
    }

    return false;
  }
public static boolean bindsTypeParameters(PsiType t, Set<? extends PsiTypeParameter> params)