ServicePoolProxies { public static <S> HealthCheckResults checkForHealthyEndPoint(S dynamicProxy) { return getPool(dynamicProxy).checkForHealthyEndPoint(); } 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);  }
@SuppressWarnings("unchecked") @Test public void testCheckForHealthyEndPoint() { ServicePool<Service> pool = mock(ServicePool.class); HealthCheckResults results = mock(HealthCheckResults.class); when(pool.checkForHealthyEndPoint()).thenReturn(results); Service service = ServicePoolProxy.create(Service.class, mock(RetryPolicy.class), pool, mock(PartitionContextSupplier.class), true); assertSame(results, ServicePoolProxies.checkForHealthyEndPoint(service)); }