// Path: src/main/java/com/plexobject/rx/scheduler/Scheduler.java
// public interface Scheduler extends Disposable {
//     /**
//      * This method registers user-defined function that is invoked by scheduler
//      * 
//      * @param consumer
//      *            - callback function to notify tick
//      * @param handle
//      *            to pass in with consumer
//      */
//     <T> void scheduleBackgroundTask(Consumer<T> consumer, T handle);
// 
//     public static Scheduler newThreadPoolScheduler(int poolSize) {
//         return new ThreadPoolScheduler(poolSize);
//     }
// 
//     public static Scheduler newImmediateScheduler() {
//         return new ImmediateScheduler();
//     }
// 
//     public static Scheduler newNewThreadScheduler() {
//         return new NewThreadScheduler();
//     }
// 
//     public static Scheduler newTimerSchedulerWithMilliInterval(long interval) {
//         return new TimerScheduler(interval);
//     }
// }


import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.TimeUnit;
import org.junit.Test;
import com.plexobject.rx.scheduler.Scheduler;
package com.plexobject.rx;





public class ObservableSchedulerTest extends BaseObservableTest {
    private static final int MAX_NUMBERS = 10;

    @Test
    public void testSubscribeFromWithTimer() throws Exception {
        List<Long> times = new ArrayList<>();

        Observable<Integer> observable = Observable.integers(1).limit(
                MAX_NUMBERS);
        initLatch(MAX_NUMBERS + 1); // N*onNext + onCompleted

// Path: src/main/java/com/plexobject/rx/scheduler/Scheduler.java
// public interface Scheduler extends Disposable {
//     /**
//      * This method registers user-defined function that is invoked by scheduler
//      * 
//      * @param consumer
//      *            - callback function to notify tick
//      * @param handle
//      *            to pass in with consumer
//      */
//     <T> void scheduleBackgroundTask(Consumer<T> consumer, T handle);
// 
//     public static Scheduler newThreadPoolScheduler(int poolSize) {
//         return new ThreadPoolScheduler(poolSize);
//     }
// 
//     public static Scheduler newImmediateScheduler() {
//         return new ImmediateScheduler();
//     }
// 
//     public static Scheduler newNewThreadScheduler() {
//         return new NewThreadScheduler();
//     }
// 
//     public static Scheduler newTimerSchedulerWithMilliInterval(long interval) {
//         return new TimerScheduler(interval);
//     }
// }


// Path: src/test/java/com/plexobject/rx/ObservableSchedulerTest.java
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.TimeUnit;
import org.junit.Test;
import com.plexobject.rx.scheduler.Scheduler;

package com.plexobject.rx;





public class ObservableSchedulerTest extends BaseObservableTest {
    private static final int MAX_NUMBERS = 10;

    @Test
    public void testSubscribeFromWithTimer() throws Exception {
        List<Long> times = new ArrayList<>();

        Observable<Integer> observable = Observable.integers(1).limit(
                MAX_NUMBERS);
        initLatch(MAX_NUMBERS + 1); // N*onNext + onCompleted

        observable.subscribeOn(Scheduler