@Test
public void waitBeforeRetry() throws InterruptedException {

    final ConstantTimeBackoff backoff = new ConstantTimeBackoff();
    // let's not wait too much in a test
    backoff.setTimeToWait(0);
    // check if the list of waiters is empty
    Assert.assertTrue(backoff.getWaiters().isEmpty());
    // call the waitBeforeRetry which will wait 0 ms and return
    backoff.waitBeforeRetry();
    // on normal exit the list of waiters should be cleared
    Assert.assertTrue(backoff.getWaiters().isEmpty());
}