code: @SuppressWarnings("unchecked")
    public static <T> T createProxy(Class<T> interfaceToProxy, T objectToProxy)
    {
      // since there is only one interface in the array, we know that the proxy must implement it!
      return (T) Proxy.newProxyInstance(interfaceToProxy.getClassLoader(),
                                        new Class<?>[] {interfaceToProxy},
                                        new ObjectProxyInvocationHandler(objectToProxy));
    }
docs: This is a convenient call when you want to proxy an object with the unique given
  interface. Note that you can use the more general call {@link Proxy#newProxyInstance(ClassLoader, Class[], InvocationHandler)}
  if you want to do something different.
  
  @param interfaceToProxy the interface to proxy
  @param objectToProxy the object to proxy (note that it must implement interfaceToProxy!)
  @return the proxied object