@Test
public void test_gotRetryableAfterDelay() {

    //noinspection ThrowableNotThrown
    final B2Exception e = new B2InternalErrorException("eek!"); // retryAfterSecs=null
    //noinspection ThrowableNotThrown
    final B2Exception withDelayFromServer = new B2InternalErrorException("test", 6, "wow!"); // retryAfterSecs=6
    int iAttempt = 1;
    assertEquals((Integer) 1, policy.gotRetryableAfterDelay(OP, iAttempt, 0, e));  iAttempt++;
    assertEquals((Integer) 2, policy.gotRetryableAfterDelay(OP, iAttempt, 0, e));  iAttempt++;
    // we use the number from the exception, if any
    assertEquals((Integer) 6, policy.gotRetryableAfterDelay(OP, iAttempt, 0, withDelayFromServer));  iAttempt++;
    // we reset to 1 after using the number from the exception.
    assertEquals((Integer) 1, policy.gotRetryableAfterDelay(OP, iAttempt, 0, e));  iAttempt++;
    assertEquals((Integer) 2, policy.gotRetryableAfterDelay(OP, iAttempt, 0, e));  iAttempt++;
    // we keep using the number from the server.
    assertEquals((Integer) 6, policy.gotRetryableAfterDelay(OP, iAttempt, 0, withDelayFromServer));  iAttempt++;
    assertEquals((Integer) 6, policy.gotRetryableAfterDelay(OP, iAttempt, 0, withDelayFromServer));  iAttempt++;
    assertNull(policy.gotRetryableAfterDelay(OP, iAttempt, 0, e));
}