ThriftClientPool<TAsyncClient> pool = new ThriftClientPool<TAsyncClient>(
new MockedMakerFactory());
assertEquals(0, pool.getNumIdle(sock));
assertEquals(0, pool.getNumActive(sock));
TAsyncClient client1 = pool.borrowClient(sock);
assertEquals(0, pool.getNumIdle(sock));
assertEquals(1, pool.getNumActive(sock));
pool.returnClient(sock, client1);
assertEquals(1, pool.getNumIdle(sock));
assertEquals(0, pool.getNumActive(sock));
TAsyncClient client2 = pool.borrowClient(sock);
assertEquals(0, pool.getNumIdle(sock));
assertEquals(1, pool.getNumActive(sock));
assertEquals(client1, client2);