code: public static Class<?> getRawClass(final Type clazz) {
      if (clazz instanceof Class) {
        return (Class<?>) clazz;
      } else if (clazz instanceof ParameterizedType) {
        return (Class<?>) ((ParameterizedType) clazz).getRawType();
      } else if (clazz instanceof WildcardType) {
        return Object.class; // XXX not really correct, but close enough?
      } else if (clazz instanceof TypeVariable) {
        return Object.class; // XXX not really correct, but close enough?
      } else {
        System.err.println("Can't getRawClass for " + clazz + " of unknown type " + clazz.getClass());
        throw new IllegalArgumentException("Can't getRawClass for " + clazz + " of unknown type " + clazz.getClass());
      }
    }
docs: Coerce a Type into a Class.  This strips out any generic paramters, and
  resolves wildcards and free parameters to Object.
  <p>
  Examples:
  <pre>{@code
  java.util.Set<String> -> java.util.Set
  ? extends T -> Object
  T -> Object
  ? -> Object
  }</pre>