@Test
public void testTakeUntilWithPublishedStream() {

    Observable<Integer> xs = Observable.range(0, RxRingBuffer.SIZE * 2);
    TestSubscriber<Integer> ts = new TestSubscriber<Integer>();
    ConnectableObservable<Integer> xsp = xs.publish();
    xsp.takeUntil(xsp.skipWhile(new Func1<Integer, Boolean>() {
        @Override
        public Boolean call(Integer i) {
            return i <= 3;
        }
    })).subscribe(ts);
    xsp.connect();
    System.out.println(ts.getOnNextEvents());
}