@Test
public void testLeaseRequestInterrupted() throws Exception {

    final StrictConnPool<String, HttpConnection> pool = new StrictConnPool<>(1, 1);
    final CountDownLatch lockHeld = new CountDownLatch(1);
    final Thread holdInternalLock = new HoldInternalLockThread(pool, lockHeld);
    holdInternalLock.start(); // Start a thread to grab the internal conn pool lock
    lockHeld.await(); // Wait until we know the internal lock is held
    Thread.currentThread().interrupt();
    // Attempt to get a connection while lock is held and thread is interrupted
    final Future<PoolEntry<String, HttpConnection>> future2 = pool.lease("somehost", null, Timeout.ofMilliseconds(10), null);
    Assert.assertTrue(Thread.interrupted());
    try {
        future2.get();
    } catch (final CancellationException cancellationException) {
        holdInternalLock.interrupt(); // Cleanup
        return;
    }
    Assert.fail("Expected interrupted exception.");
}