code: public static void setInvocationHandlerStatic(Object proxy, InvocationHandler handler) {
          try {
              final Field field = proxy.getClass().getDeclaredField(INVOCATION_HANDLER_FIELD);
              AccessController.doPrivileged(new SetAccessiblePrivilege(field));
              field.set(proxy, handler);
          } catch (NoSuchFieldException e) {
              throw new RuntimeException("Could not find invocation handler on generated proxy", e);
          } catch (IllegalArgumentException e) {
              throw new RuntimeException(e);
          } catch (IllegalAccessException e) {
              throw new RuntimeException(e);
          }
      }
docs: Sets the invocation handler for a proxy. This method is less efficient than
  {@link #setInvocationHandler(Object, InvocationHandler)}, however it will work on any proxy, not just proxies from a
  specific factory.
  
  @param proxy the proxy to modify
  @param handler the handler to use