@Test
public void testShutdown() throws Exception {
LocalConnFactory connFactory = Mockito.mock(LocalConnFactory.class);
HttpConnection conn1 = Mockito.mock(HttpConnection.class);
Mockito.when(conn1.isOpen()).thenReturn(true);
Mockito.when(connFactory.create(Mockito.eq("somehost"))).thenReturn(conn1);
HttpConnection conn2 = Mockito.mock(HttpConnection.class);
Mockito.when(conn2.isOpen()).thenReturn(true);
Mockito.when(connFactory.create(Mockito.eq("otherhost"))).thenReturn(conn2);
LocalConnPool pool = new LocalConnPool(connFactory, 2, 2);
Future<LocalPoolEntry> future1 = pool.lease("somehost", null);
LocalPoolEntry entry1 = future1.get(1, TimeUnit.SECONDS);