code: public static Type resolveWildcardTypeOrTypeVariable(List<Type> context, Type type) {
      // first deal with a wildcard, e.g. ? extends Number
      if (type instanceof WildcardType) {
        type = Types.getBound((WildcardType) type);
      }
      // next deal with a type variable T
      while (type instanceof TypeVariable<?>) {
        // resolve the type variable
        Type resolved = Types.resolveTypeVariable(context, (TypeVariable<?>) type);
        if (resolved != null) {
          type = resolved;
        }
        // if unable to fully resolve the type variable, use its bounds, e.g. T extends Number
        if (type instanceof TypeVariable<?>) {
          type = ((TypeVariable<?>) type).getBounds()[0];
        }
        // loop in case T extends U and U is also a type variable
      }
      return type;
    }
docs: Aggressively resolves the given type in such a way that the resolved type is not a wildcard
  type or a type variable, returning {@code Object.class} if the type variable cannot be
  resolved.
  
  @param context context list, ordering from least specific to most specific type context, for
  example container class and then its field
  @param type type or {@code null} for {@code null} result
  @return resolved type (which may be class, parameterized type, or generic array type, but not
  wildcard type or type variable) or {@code null} for {@code null} input