@Test public void testConcatUnsubscribeConcurrent() { final CountDownLatch callOnce = new CountDownLatch(1); final CountDownLatch okToContinue = new CountDownLatch(1); final TestObservable<String> w1 = new TestObservable<String>("one", "two", "three"); final TestObservable<String> w2 = new TestObservable<String>(callOnce, okToContinue, "four", "five", "six"); @SuppressWarnings("unchecked") Observer<String> observer = mock(Observer.class); @SuppressWarnings("unchecked") TestObservable<Observable<String>> observableOfObservables = new TestObservable<Observable<String>>(Observable.create(w1), Observable.create(w2)); Observable.OnSubscribeFunc<String> concatF = concat(Observable.create(observableOfObservables)); Observable<String> concat = Observable.create(concatF); Subscription s1 = concat.subscribe(observer); try { callOnce.await(); s1.unsubscribe(); okToContinue.countDown(); w1.t.join(); w2.t.join(); } catch (Throwable e) { e.printStackTrace(); fail(e.getMessage()); } InOrder inOrder = inOrder(observer); inOrder.verify(observer, times(1)).onNext("one"); inOrder.verify(observer, times(1)).onNext("two"); inOrder.verify(observer, times(1)).onNext("three"); inOrder.verify(observer, times(1)).onNext("four"); inOrder.verify(observer, never()).onNext("five"); inOrder.verify(observer, never()).onNext("six"); verify(observer, never()).onCompleted(); verify(observer, never()).onError(any(Throwable.class)); }
public static <T> OnSubscribeFunc<T> concat(final Observable<? extends T>... sequences) { return concat(Observable.from(sequences)); }
OperationConcat { public static <T> OnSubscribeFunc<T> concat(final Observable<? extends T>... sequences) { return concat(Observable.from(sequences)); } }
OperationConcat { public static <T> OnSubscribeFunc<T> concat(final Observable<? extends T>... sequences) { return concat(Observable.from(sequences)); }  }
OperationConcat { public static <T> OnSubscribeFunc<T> concat(final Observable<? extends T>... sequences) { return concat(Observable.from(sequences)); }  static OnSubscribeFunc<T> concat(final Observable<? extends T>... sequences); static OnSubscribeFunc<T> concat(final Iterable<? extends Observable<? extends T>> sequences); static OnSubscribeFunc<T> concat(final Observable<? extends Observable<? extends T>> sequences); }
OperationConcat { public static <T> OnSubscribeFunc<T> concat(final Observable<? extends T>... sequences) { return concat(Observable.from(sequences)); }  static OnSubscribeFunc<T> concat(final Observable<? extends T>... sequences); static OnSubscribeFunc<T> concat(final Iterable<? extends Observable<? extends T>> sequences); static OnSubscribeFunc<T> concat(final Observable<? extends Observable<? extends T>> sequences);  }