public void testShouldRetryRetryWait() throws InterruptedException {
ShouldRetryIo should = new ShouldRetryIo(300, 100);
long stop = System.currentTimeMillis() + 300;
while (stop < System.currentTimeMillis()) {
long now = System.currentTimeMillis();
should.shouldRetry();
long delay = System.currentTimeMillis() - now;
assertTrue("Delay should be greater than 90 and less than 110: " +
delay,
delay > 90 && delay < 110);
}