// Path: common-test/src/main/java/net/javacrumbs/futureconverter/common/test/OriginalFutureTestHelper.java
// public interface OriginalFutureTestHelper<F extends Future<String>> {
// 
//     F createFinishedFuture();
// 
//     F createRunningFuture();
// 
//     F createExceptionalFuture(Exception exception);
// 
//     void finishRunningFuture();
// }
// 
// Path: common-test/src/main/java/net/javacrumbs/futureconverter/common/test/AbstractConverterTest.java
// public static final String VALUE = "test";


import static org.junit.Assert.assertTrue;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyNoInteractions;
import net.javacrumbs.futureconverter.common.test.OriginalFutureTestHelper;
import org.junit.After;
import org.junit.Test;
import rx.Single;
import rx.Subscription;
import rx.functions.Action1;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import static net.javacrumbs.futureconverter.common.test.AbstractConverterTest.VALUE;
import static org.junit.Assert.assertSame;
        Action1<Throwable> onError1 = mockAction();

        // first subscription
        single.subscribe(v -> {
                onSuccess1.call(v);
                latch.countDown();
            },
            onError1);
        verifyNoInteractions(onSuccess1);
        verifyNoInteractions(onError1);

        // second subscription
        Action1<String> onSuccess2 = mockAction();
        Action1<Throwable> onError2 = mockAction();


        single.subscribe(v -> {
                onSuccess2.call(v);
                latch.countDown();
            },
            onError2);
        verifyNoInteractions(onSuccess2);
        verifyNoInteractions(onError2);


        originalFutureTestHelper.finishRunningFuture();

        //wait for the result
        latch.await();

// Path: common-test/src/main/java/net/javacrumbs/futureconverter/common/test/OriginalFutureTestHelper.java
// public interface OriginalFutureTestHelper<F extends Future<String>> {
// 
//     F createFinishedFuture();
// 
//     F createRunningFuture();
// 
//     F createExceptionalFuture(Exception exception);
// 
//     void finishRunningFuture();
// }
// 
// Path: common-test/src/main/java/net/javacrumbs/futureconverter/common/test/AbstractConverterTest.java
// public static final String VALUE = "test";


// Path: common-test/src/main/java/net/javacrumbs/futureconverter/common/test/rxjava/AbstractFutureToSingleConverterTest.java
import static org.junit.Assert.assertTrue;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyNoInteractions;
import net.javacrumbs.futureconverter.common.test.OriginalFutureTestHelper;
import org.junit.After;
import org.junit.Test;
import rx.Single;
import rx.Subscription;
import rx.functions.Action1;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import static net.javacrumbs.futureconverter.common.test.AbstractConverterTest.VALUE;
import static org.junit.Assert.assertSame;

        Action1<Throwable> onError1 = mockAction();

        // first subscription
        single.subscribe(v -> {
                onSuccess1.call(v);
                latch.countDown();
            },
            onError1);
        verifyNoInteractions(onSuccess1);
        verifyNoInteractions(onError1);

        // second subscription
        Action1<String> onSuccess2 = mockAction();
        Action1<Throwable> onError2 = mockAction();


        single.subscribe(v -> {
                onSuccess2.call(v);
                latch.countDown();
            },
            onError2);
        verifyNoInteractions(onSuccess2);
        verifyNoInteractions(onError2);


        originalFutureTestHelper.finishRunningFuture();

        //wait for the result
        latch.await();

        verify(onSuccess1).call(VALUE);