@Test public void testInterval() { Observable<Long> w = Observable.create(OperationInterval.interval(1, TimeUnit.SECONDS, scheduler)); Subscription sub = w.subscribe(observer); verify(observer, never()).onNext(0L); verify(observer, never()).onCompleted(); verify(observer, never()).onError(any(Throwable.class)); scheduler.advanceTimeTo(2, TimeUnit.SECONDS); InOrder inOrder = inOrder(observer); inOrder.verify(observer, times(1)).onNext(0L); inOrder.verify(observer, times(1)).onNext(1L); inOrder.verify(observer, never()).onNext(2L); verify(observer, never()).onCompleted(); verify(observer, never()).onError(any(Throwable.class)); sub.unsubscribe(); scheduler.advanceTimeTo(4, TimeUnit.SECONDS); verify(observer, never()).onNext(2L); verify(observer, never()).onCompleted(); verify(observer, never()).onError(any(Throwable.class)); }
public static OnSubscribeFunc<Long> interval(long interval, TimeUnit unit) { return interval(interval, unit, Schedulers.computation()); }
OperationInterval { public static OnSubscribeFunc<Long> interval(long interval, TimeUnit unit) { return interval(interval, unit, Schedulers.computation()); } }
OperationInterval { public static OnSubscribeFunc<Long> interval(long interval, TimeUnit unit) { return interval(interval, unit, Schedulers.computation()); }  }
OperationInterval { public static OnSubscribeFunc<Long> interval(long interval, TimeUnit unit) { return interval(interval, unit, Schedulers.computation()); }  static OnSubscribeFunc<Long> interval(long interval, TimeUnit unit); static OnSubscribeFunc<Long> interval(final long interval, final TimeUnit unit, final Scheduler scheduler); }
OperationInterval { public static OnSubscribeFunc<Long> interval(long interval, TimeUnit unit) { return interval(interval, unit, Schedulers.computation()); }  static OnSubscribeFunc<Long> interval(long interval, TimeUnit unit); static OnSubscribeFunc<Long> interval(final long interval, final TimeUnit unit, final Scheduler scheduler);  }