9899100101102103104105106107108
for (int i = 0; i < 10; i++) { switch (i) { case 0: case 1: assertTrue(policy.shouldRetry(i)); break; default: assertFalse(policy.shouldRetry(i)); } }
101102103104105106107108109110111
case 0: case 1: assertTrue(policy.shouldRetry(i)); break; default: assertFalse(policy.shouldRetry(i)); } } } private long doDelay(OptimisticLockRetryPolicy policy, int i) throws InterruptedException {
110111112113114115116117118119120
113114115116117118119120121122
case 0: case 1: assertTrue(policy.shouldRetry(i)); break; default: assertFalse(policy.shouldRetry(i)); } } } }