docs: @SuppressWarnings("unchecked")
    public static <T> Class<T> deProxy(Class<?> type) {
      // Ignore JDK proxies
      if (type.isInterface())
        return (Class<T>) type;
  
      if (isProxied(type)) {
        final Class<?> superclass = type.getSuperclass();
        if (!superclass.equals(Object.class) && !superclass.equals(Proxy.class))
          return (Class<T>) superclass;
        else {
          Class<?>[] interfaces = type.getInterfaces();
          if (interfaces.length > 0)
            return (Class<T>) interfaces[0];
        }
      }
  
      return (Class<T>) type;
    }