@Test
public void observeOnTheSameSchedulerTwice() {

    TestScheduler scheduler = new TestScheduler();
    Observable<Integer> o = Observable.from(1, 2, 3);
    Observable<Integer> o2 = o.observeOn(scheduler);
    @SuppressWarnings("unchecked")
    Observer<Object> observer1 = mock(Observer.class);
    @SuppressWarnings("unchecked")
    Observer<Object> observer2 = mock(Observer.class);
    InOrder inOrder1 = inOrder(observer1);
    InOrder inOrder2 = inOrder(observer2);
    o2.subscribe(observer1);
    o2.subscribe(observer2);
    scheduler.advanceTimeBy(1, TimeUnit.SECONDS);
    inOrder1.verify(observer1, times(1)).onNext(1);
    inOrder1.verify(observer1, times(1)).onNext(2);
    inOrder1.verify(observer1, times(1)).onNext(3);
    inOrder1.verify(observer1, times(1)).onCompleted();
    verify(observer1, never()).onError(any(Throwable.class));
    inOrder1.verifyNoMoreInteractions();
    inOrder2.verify(observer2, times(1)).onNext(1);
    inOrder2.verify(observer2, times(1)).onNext(2);
    inOrder2.verify(observer2, times(1)).onNext(3);
    inOrder2.verify(observer2, times(1)).onCompleted();
    verify(observer2, never()).onError(any(Throwable.class));
    inOrder2.verifyNoMoreInteractions();
}