LeaseMaintainerImpl implements LeaseMaintainer, LeaseReconnectListener { @Override public void waitForLease() throws InterruptedException { hasLease.await(); } LeaseMaintainerImpl(LeaseAcquirer leaseAcquirer); @Override Lease getCurrentLease(); @Override void waitForLease(); @Override boolean waitForLease(long timeout, TimeUnit timeUnit); @Override void close(); @Override void reconnecting(); @Override void reconnected(); @Override void destroy();  }
@Test(expected = InterruptedException.class) public void waitForLeaseWithoutALease() throws Exception { ThreadInterrupter.interruptIn(300L); leaseMaintainer.waitForLease(); }