Connection con = new TestConnectionImpl();
Connection proxy = ProxyFactory.createProxy(con, new GenericInvocationHandler<Connection>(con));
// if the underlying object extends the class (or matches the class) then the underlying object should be returned.
{
AbstractTestConnection unwrapped = proxy.unwrap(AbstractTestConnection.class);
assertFalse(ProxyFactory.isProxy(unwrapped));
}
{
TestConnectionImpl unwrapped = proxy.unwrap(TestConnectionImpl.class);