@Test
public void testTwoSubscribersOneSlowOneFast() throws Exception {

    final CountDownLatch latch = new CountDownLatch(1);
    final AtomicBoolean foundError = new AtomicBoolean(false);
    Observable<HystrixUtilization> fast = stream
            .observe()
            .observeOn(Schedulers.newThread());
    Observable<HystrixUtilization> slow = stream
            .observe()
            .observeOn(Schedulers.newThread())
            .map(new Func1<HystrixUtilization, HystrixUtilization>() {
                @Override
                public HystrixUtilization call(HystrixUtilization util) {
                    try {
                        Thread.sleep(100);
                        return util;
                    } catch (InterruptedException ex) {
                        return util;
                    }
                }
            });
    Observable<Boolean> checkZippedEqual = Observable.zip(fast, slow, new Func2<HystrixUtilization, HystrixUtilization, Boolean>() {
        @Override
        public Boolean call(HystrixUtilization payload, HystrixUtilization payload2) {
            return payload == payload2;
        }
    });
    Subscription s1 = checkZippedEqual
            .take(10000)
            .subscribe(new Subscriber<Boolean>() {
                @Override
                public void onCompleted() {
                    System.out.println(System.currentTimeMillis() + " : " + Thread.currentThread().getName() + " : OnCompleted");
                    latch.countDown();
                }
                @Override
                public void onError(Throwable e) {
                    System.out.println(System.currentTimeMillis() + " : " + Thread.currentThread().getName() + " : OnError : " + e);
                    e.printStackTrace();
                    foundError.set(true);
                    latch.countDown();
                }
                @Override
                public void onNext(Boolean b) {
                    //System.out.println(System.currentTimeMillis() + " : " + Thread.currentThread().getName() + " : OnNext : " + b);
                }
            });
    for (int i = 0; i < 50; i++) {
        HystrixCommand<Integer> cmd = Command.from(groupKey, commandKey, HystrixEventType.SUCCESS, 50);
        cmd.execute();
    }
    latch.await(10000, TimeUnit.MILLISECONDS);
    assertFalse(foundError.get());
}