@Test
public void testInterrupt() throws InterruptedException {

    Lock      lck = new ReentrantLock();
    Condition cnd = lck.newCondition();
    WaitingThread wt = new WaitingThread(cnd, null);
    AwaitThread ath = new AwaitThread(wt, lck, null);
    ath.start();
    Thread.sleep(100); // give extra thread time to block
    Assert.assertNull("thread caught exception", ath.getException());
    Assert.assertTrue("thread not waiting", ath.isWaiting());
    Assert.assertEquals("wrong thread", ath, wt.getThread());
    ath.interrupt();
    Thread.sleep(100); // give extra thread time to wake up
    Assert.assertFalse("thread still waiting", ath.isWaiting());
    Assert.assertNotNull("thread didn't catch exception", ath.getException());
    Assert.assertTrue("thread caught wrong exception",
               ath.getException() instanceof InterruptedException);
    Assert.assertNull("thread still there", wt.getThread());
}