@Test public void testSkipTimed() { TestScheduler scheduler = new TestScheduler(); PublishSubject<Integer> source = PublishSubject.create(); Observable<Integer> result = source.skip(1, TimeUnit.SECONDS, scheduler); Observer<Object> o = mock(Observer.class); result.subscribe(o); source.onNext(1); source.onNext(2); source.onNext(3); scheduler.advanceTimeBy(1, TimeUnit.SECONDS); source.onNext(4); source.onNext(5); source.onNext(6); source.onCompleted(); InOrder inOrder = inOrder(o); inOrder.verify(o, never()).onNext(1); inOrder.verify(o, never()).onNext(2); inOrder.verify(o, never()).onNext(3); inOrder.verify(o).onNext(4); inOrder.verify(o).onNext(5); inOrder.verify(o).onNext(6); inOrder.verify(o).onCompleted(); inOrder.verifyNoMoreInteractions(); verify(o, never()).onError(any(Throwable.class)); }
public static <T> OnSubscribeFunc<T> skip(final Observable<? extends T> items, final int num) { return new OnSubscribeFunc<T>() { @Override public Subscription onSubscribe(Observer<? super T> observer) { return new Skip<T>(items, num).onSubscribe(observer); } }; }
OperationSkip { public static <T> OnSubscribeFunc<T> skip(final Observable<? extends T> items, final int num) { return new OnSubscribeFunc<T>() { @Override public Subscription onSubscribe(Observer<? super T> observer) { return new Skip<T>(items, num).onSubscribe(observer); } }; } }
OperationSkip { public static <T> OnSubscribeFunc<T> skip(final Observable<? extends T> items, final int num) { return new OnSubscribeFunc<T>() { @Override public Subscription onSubscribe(Observer<? super T> observer) { return new Skip<T>(items, num).onSubscribe(observer); } }; }  }
OperationSkip { public static <T> OnSubscribeFunc<T> skip(final Observable<? extends T> items, final int num) { return new OnSubscribeFunc<T>() { @Override public Subscription onSubscribe(Observer<? super T> observer) { return new Skip<T>(items, num).onSubscribe(observer); } }; }  static OnSubscribeFunc<T> skip(final Observable<? extends T> items, final int num); }
OperationSkip { public static <T> OnSubscribeFunc<T> skip(final Observable<? extends T> items, final int num) { return new OnSubscribeFunc<T>() { @Override public Subscription onSubscribe(Observer<? super T> observer) { return new Skip<T>(items, num).onSubscribe(observer); } }; }  static OnSubscribeFunc<T> skip(final Observable<? extends T> items, final int num);  }