// Path: src/main/java/com/github/davidmoten/rx2/RetryWhen.java
// public static final class ErrorAndDuration {
// 
//     private final Throwable throwable;
//     private final long durationMs;
// 
//     public ErrorAndDuration(Throwable throwable, long durationMs) {
//         this.throwable = throwable;
//         this.durationMs = durationMs;
//     }
// 
//     public Throwable throwable() {
//         return throwable;
//     }
// 
//     public long durationMs() {
//         return durationMs;
//     }
// 
// }


import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import java.sql.SQLException;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
import org.junit.Test;
import org.reactivestreams.Subscription;
import com.github.davidmoten.junit.Asserts;
import com.github.davidmoten.rx2.RetryWhen.ErrorAndDuration;
import io.reactivex.Flowable;
import io.reactivex.functions.Consumer;
import io.reactivex.functions.Predicate;
import io.reactivex.schedulers.Schedulers;
import io.reactivex.schedulers.TestScheduler;
import io.reactivex.subscribers.TestSubscriber;
package com.github.davidmoten.rx2;






public class RetryWhenTest {

    @Test
    public void isUtilityClass() {
        Asserts.assertIsUtilityClass(RetryWhen.class);
    }

    @Test
    public void testExponentialBackoff() {
        Exception ex = new IllegalArgumentException("boo");
        TestSubscriber<Integer> ts = TestSubscriber.create();
        final AtomicInteger logCalls = new AtomicInteger();
// Path: src/main/java/com/github/davidmoten/rx2/RetryWhen.java
// public static final class ErrorAndDuration {
// 
//     private final Throwable throwable;
//     private final long durationMs;
// 
//     public ErrorAndDuration(Throwable throwable, long durationMs) {
//         this.throwable = throwable;
//         this.durationMs = durationMs;
//     }
// 
//     public Throwable throwable() {
//         return throwable;
//     }
// 
//     public long durationMs() {
//         return durationMs;
//     }
// 
// }


// Path: src/test/java/com/github/davidmoten/rx2/RetryWhenTest.java
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import java.sql.SQLException;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
import org.junit.Test;
import org.reactivestreams.Subscription;
import com.github.davidmoten.junit.Asserts;
import com.github.davidmoten.rx2.RetryWhen.ErrorAndDuration;
import io.reactivex.Flowable;
import io.reactivex.functions.Consumer;
import io.reactivex.functions.Predicate;
import io.reactivex.schedulers.Schedulers;
import io.reactivex.schedulers.TestScheduler;
import io.reactivex.subscribers.TestSubscriber;

package com.github.davidmoten.rx2;






public class RetryWhenTest {

    @Test
    public void isUtilityClass() {
        Asserts.assertIsUtilityClass(RetryWhen.class);
    }

    @Test
    public void testExponentialBackoff() {
        Exception ex = new IllegalArgumentException("boo");
        TestSubscriber<Integer> ts = TestSubscriber.create();
        final AtomicInteger logCalls = new AtomicInteger();
        Consumer<ErrorAndDuration> log = new Consumer<ErrorAndDuration>() {