code: private static Class<?> toClass(Type o)
      {
          if (o instanceof GenericArrayType)
          {
              Class clazz = Array.newInstance(toClass(((GenericArrayType) o).getGenericComponentType()), 0).getClass();
              return clazz;
          }
          return (Class<?>) o;
      }
docs: Borrowed from java.lang.class
  
  @param o
  @return