Connection proxy = ProxyFactory.createProxy(underlying, new GenericInvocationHandler<Connection>(underlying));
// TestConnection is an interface of the actual connection but not of the proxy. Unwrapping works
// but a proxy is not returned
{
TestConnection unwrapped = proxy.unwrap(TestConnection.class);
assertFalse(ProxyFactory.isProxy(unwrapped));
}
// ResultSet is not implemented at all - an exception will be thrown
try {