@Test
@SuppressWarnings("unchecked")
public void testObserveOn() {

    Observer<Integer> observer = mock(Observer.class);
    Observable.create(observeOn(Observable.from(1, 2, 3), Schedulers.immediate())).subscribe(observer);
    verify(observer, times(1)).onNext(1);
    verify(observer, times(1)).onNext(2);
    verify(observer, times(1)).onNext(3);
    verify(observer, times(1)).onCompleted();
}