InvocationHandler handler = new EndpointInvocationHandler(endpoint, session, businessInterface);
ProxyFactory factory = new ProxyFactory();
factory.setHandler(new MethodHandlerAdapter(handler));
factory.setInterfaces(new Class[] { businessInterface });
SimpleInterface javassistProxy = (SimpleInterface) factory.create(null, null);
ClassLoader loader = Thread.currentThread().getContextClassLoader();
SimpleInterface proxy = EndpointProxy.newProxyInstance(loader, session, businessInterface, endpoint);
assertTrue(javassistProxy.equals(proxy));