@Test(groups = { "unit" }, timeOut = TIMEOUT)

public void shouldRetryWithGoneException() {
    RxDocumentServiceRequest request = RxDocumentServiceRequest.create(OperationType.Read, ResourceType.Document);
    GoneAndRetryWithRetryPolicy goneAndRetryWithRetryPolicy = new GoneAndRetryWithRetryPolicy(request, 30);
    Single<IRetryPolicy.ShouldRetryResult> singleShouldRetry = goneAndRetryWithRetryPolicy
            .shouldRetry(new GoneException());
    IRetryPolicy.ShouldRetryResult shouldRetryResult = singleShouldRetry.toBlocking().value();
    assertThat(shouldRetryResult.shouldRetry).isTrue();
    assertThat(shouldRetryResult.policyArg.getValue0()).isTrue();
    assertThat(shouldRetryResult.policyArg.getValue3()).isEqualTo(1);
    assertThat(shouldRetryResult.backOffTime.getSeconds()).isEqualTo(0);
    singleShouldRetry = goneAndRetryWithRetryPolicy.shouldRetry(new GoneException());
    shouldRetryResult = singleShouldRetry.toBlocking().value();
    assertThat(shouldRetryResult.shouldRetry).isTrue();
    assertThat(shouldRetryResult.policyArg.getValue0()).isTrue();
    assertThat(shouldRetryResult.policyArg.getValue3()).isEqualTo(2);
    assertThat(shouldRetryResult.backOffTime.getSeconds()).isEqualTo(1);
    singleShouldRetry = goneAndRetryWithRetryPolicy.shouldRetry(new GoneException());
    shouldRetryResult = singleShouldRetry.toBlocking().value();
    assertThat(shouldRetryResult.shouldRetry).isTrue();
    assertThat(shouldRetryResult.policyArg.getValue0()).isTrue();
    assertThat(shouldRetryResult.policyArg.getValue3()).isEqualTo(3);
    assertThat(shouldRetryResult.backOffTime.getSeconds()).isEqualTo(2);
    singleShouldRetry = goneAndRetryWithRetryPolicy.shouldRetry(new GoneException());
    shouldRetryResult = singleShouldRetry.toBlocking().value();
    assertThat(shouldRetryResult.shouldRetry).isTrue();
    assertThat(shouldRetryResult.policyArg.getValue0()).isTrue();
    assertThat(shouldRetryResult.policyArg.getValue3()).isEqualTo(4);
    assertThat(shouldRetryResult.backOffTime.getSeconds()).isEqualTo(4);
}