ServicePoolProxies { public static boolean isProxy(Object dynamicProxy) { return dynamicProxy instanceof Proxy && Proxy.getInvocationHandler(dynamicProxy) instanceof ServicePoolProxy; } private  ServicePoolProxies(); static boolean isProxy(Object dynamicProxy); static void close(S dynamicProxy); static int getNumValidEndPoints(S dynamicProxy); static int getNumBadEndPoints(S dynamicProxy); static HealthCheckResults checkForHealthyEndPoint(S dynamicProxy); static com.bazaarvoice.ostrich.ServicePool<S> getPool(S dynamicProxy);  }
@Test public void testIsNotProxyNull() throws IOException { assertFalse(ServicePoolProxies.isProxy(null)); }
@Test public void testIsNotProxyNonProxy() throws IOException { assertFalse(ServicePoolProxies.isProxy(new Object())); }
@Test public void testIsNotProxyNonServicePoolProxy() throws IOException { Service service = Reflection.newProxy(Service.class, mock(InvocationHandler.class)); assertFalse(ServicePoolProxies.isProxy(service)); }
@Test public void testIsProxy() throws IOException { @SuppressWarnings("unchecked") Service service = ServicePoolProxy.create(Service.class, mock(RetryPolicy.class), mock(ServicePool.class), mock(PartitionContextSupplier.class), true); assertTrue(ServicePoolProxies.isProxy(service)); }