@Test
public void cancelRace() {

    AsyncSubject<Object> p = AsyncSubject.create();
    for (int i = 0; i < TestHelper.RACE_DEFAULT_LOOPS; i++) {
        final TestObserver<Object> to1 = p.test();
        final TestObserver<Object> to2 = p.test();
        Runnable r1 = new Runnable() {
            @Override
            public void run() {
                to1.cancel();
            }
        };
        Runnable r2 = new Runnable() {
            @Override
            public void run() {
                to2.cancel();
            }
        };
        TestHelper.race(r1, r2);
    }
}