code: private static Class<?> typeToClass(Type t)
    {
      if(t instanceof Class<?>) {
        return (Class<?>)t;
      }
      if(t instanceof ParameterizedType) {
        return (Class<?>)((ParameterizedType)t).getRawType();
      }
      throw new BugError("Unknown type %s to convert to class.", t);
    }
docs: Cast Java reflective type to language class. If <code>type</code> is instance of {@link Class} just return it. If
  is parameterized type returns the raw class.
  
  @param t Java reflective type.
  @return the class described by given <code>type</code>.