static Object redirect(Object proxy, InvocationHandler handler, Method m,
      Object... args) throws Throwable {
    try {
      return handler.invoke(proxy, m, args);
    } catch (final Throwable t) {
      if (t == null)
        throw new Exception(
            "An exception was here, but apparently it decided to go away.");
      if ((t instanceof RuntimeException) || (t instanceof Error))
        throw t;
      for (final Class c : m.getExceptionTypes())
        if (c.isInstance(t))
          throw t;
      throw new UndeclaredThrowableException(t);
    }
  }