@Test
public void subscribeOnNextRace() {

    for (int i = 0; i < TestHelper.RACE_DEFAULT_LOOPS; i++) {
        final PublishSubject<Integer> ps = PublishSubject.create();
        final ConnectableObservable<Integer> co = ps.replay();
        final TestObserver<Integer> to1 = new TestObserver<Integer>();
        Runnable r1 = new Runnable() {
            @Override
            public void run() {
                co.subscribe(to1);
            }
        };
        Runnable r2 = new Runnable() {
            @Override
            public void run() {
                for (int j = 0; j < 1000; j++) {
                    ps.onNext(j);
                }
            }
        };
        TestHelper.race(r1, r2);
    }
}