// Path: src/main/java/rx/marble/ColdObservable.java
// public class ColdObservable<T> extends Observable<T> implements TestableObservable<T> {
// 
//     private final List<Recorded<T>> notifications;
//     private List<SubscriptionLog> subscriptions = new ArrayList<>();
// 
//     private ColdObservable(OnSubscribe<T> f, List<Recorded<T>> notifications) {
//         super(f);
//         this.notifications = notifications;
//     }
// 
//     @Override
//     public List<SubscriptionLog> getSubscriptions() {
//         return Collections.unmodifiableList(subscriptions);
//     }
// 
//     @Override
//     public List<Recorded<T>> getMessages() {
//         return Collections.unmodifiableList(notifications);
//     }
// 
//     public static <T> ColdObservable<T> create(Scheduler scheduler, Recorded<T>... notifications) {
//         return create(scheduler, Arrays.asList(notifications));
//     }
// 
//     public static <T> ColdObservable<T> create(Scheduler scheduler, List<Recorded<T>> notifications) {
//         OnSubscribeHandler<T> onSubscribeFunc = new OnSubscribeHandler<>(scheduler, notifications);
//         ColdObservable<T> observable = new ColdObservable<>(onSubscribeFunc, notifications);
//         onSubscribeFunc.observable = observable;
//         return observable;
//     }
// 
// 
//     private static class OnSubscribeHandler<T> implements Observable.OnSubscribe<T> {
// 
//         private final Scheduler scheduler;
//         private final List<Recorded<T>> notifications;
//         public ColdObservable observable;
// 
//         public OnSubscribeHandler(Scheduler scheduler, List<Recorded<T>> notifications) {
//             this.scheduler = scheduler;
//             this.notifications = notifications;
//         }
// 
//         public void call(final Subscriber<? super T> subscriber) {
//             final SubscriptionLog subscriptionLog = new SubscriptionLog(scheduler.now());
//             observable.subscriptions.add(subscriptionLog);
//             final int subscriptionIndex = observable.getSubscriptions().size() - 1;
//             Scheduler.Worker worker = scheduler.createWorker();
//             subscriber.add(worker); // not scheduling after unsubscribe
// 
//             for (final Recorded<T> notification: notifications) {
//                 worker.schedule(new Action0() {
//                     @Override
//                     public void call() {
//                         notification.value.accept(subscriber);
//                     }
//                 }, notification.time, TimeUnit.MILLISECONDS);
//             }
// 
//             subscriber.add((Subscriptions.create(new Action0() {
//                 @Override
//                 public void call() {
//                     // on unsubscribe
//                     observable.subscriptions.set(
//                             subscriptionIndex,
//                             new SubscriptionLog(subscriptionLog.subscribe, scheduler.now())
//                     );
//                 }
//             })));
//         }
//     }
// }
// 
// Path: src/main/java/rx/marble/MapHelper.java
// public static <V> Map<String, V> of(String k, V v) {
//     return Collections.singletonMap(k,v);
// }
// 
// Path: src/main/java/rx/marble/junit/MarbleRule.java
// public class MarbleRule implements TestRule {
// 
//     private static ThreadLocal<MarbleScheduler> schedulerHolder = new ThreadLocal<>();
// 
//     public final MarbleScheduler scheduler;
// 
//     public MarbleRule() {
//         scheduler = new MarbleScheduler();
//     }
// 
//     public MarbleRule(long frameTimeFactor) {
//         scheduler = new MarbleScheduler(frameTimeFactor);
//     }
// 
//     public static <T> HotObservable<T> hot(String marbles, Map<String, T> values) {
//         return schedulerHolder.get().createHotObservable(marbles, values);
//     }
// 
//     public static HotObservable<String> hot(String marbles) {
//         return schedulerHolder.get().createHotObservable(marbles);
//     }
// 
//     public static <T> ColdObservable<T> cold(String marbles, Map<String, T> values) {
//         return schedulerHolder.get().createColdObservable(marbles, values);
//     }
// 
//     public static ColdObservable<String> cold(String marbles) {
//         return schedulerHolder.get().createColdObservable(marbles);
//     }
// 
//     public static ISetupTest expectObservable(Observable<?> actual) {
//         return schedulerHolder.get().expectObservable(actual);
//     }
// 
//     public static ISetupTest expectObservable(Observable<?> actual, String unsubscriptionMarbles) {
//         return schedulerHolder.get().expectObservable(actual, unsubscriptionMarbles);
//     }
// 
//     public static ISetupSubscriptionsTest expectSubscriptions(List<SubscriptionLog> subscriptions) {
//         return schedulerHolder.get().expectSubscriptions(subscriptions);
//     }
// 
//     @Override
//     public Statement apply(final Statement base, Description description) {
//         return new Statement() {
//             @Override
//             public void evaluate() throws Throwable {
//                 schedulerHolder.set(scheduler);
//                 try {
//                     base.evaluate();
//                     scheduler.flush();
//                 } finally {
//                     schedulerHolder.remove();
//                 }
// 
//             }
//         };
//     }
// }


import org.junit.Rule;
import org.junit.Test;
import rx.Observable;
import rx.functions.Func1;
import rx.functions.Func2;
import rx.marble.ColdObservable;
import java.util.Map;
import static rx.marble.MapHelper.of;
import static rx.marble.junit.MarbleRule.*;
package rx.marble.junit;





public class DemoTest {

    @Rule
// Path: src/main/java/rx/marble/ColdObservable.java
// public class ColdObservable<T> extends Observable<T> implements TestableObservable<T> {
// 
//     private final List<Recorded<T>> notifications;
//     private List<SubscriptionLog> subscriptions = new ArrayList<>();
// 
//     private ColdObservable(OnSubscribe<T> f, List<Recorded<T>> notifications) {
//         super(f);
//         this.notifications = notifications;
//     }
// 
//     @Override
//     public List<SubscriptionLog> getSubscriptions() {
//         return Collections.unmodifiableList(subscriptions);
//     }
// 
//     @Override
//     public List<Recorded<T>> getMessages() {
//         return Collections.unmodifiableList(notifications);
//     }
// 
//     public static <T> ColdObservable<T> create(Scheduler scheduler, Recorded<T>... notifications) {
//         return create(scheduler, Arrays.asList(notifications));
//     }
// 
//     public static <T> ColdObservable<T> create(Scheduler scheduler, List<Recorded<T>> notifications) {
//         OnSubscribeHandler<T> onSubscribeFunc = new OnSubscribeHandler<>(scheduler, notifications);
//         ColdObservable<T> observable = new ColdObservable<>(onSubscribeFunc, notifications);
//         onSubscribeFunc.observable = observable;
//         return observable;
//     }
// 
// 
//     private static class OnSubscribeHandler<T> implements Observable.OnSubscribe<T> {
// 
//         private final Scheduler scheduler;
//         private final List<Recorded<T>> notifications;
//         public ColdObservable observable;
// 
//         public OnSubscribeHandler(Scheduler scheduler, List<Recorded<T>> notifications) {
//             this.scheduler = scheduler;
//             this.notifications = notifications;
//         }
// 
//         public void call(final Subscriber<? super T> subscriber) {
//             final SubscriptionLog subscriptionLog = new SubscriptionLog(scheduler.now());
//             observable.subscriptions.add(subscriptionLog);
//             final int subscriptionIndex = observable.getSubscriptions().size() - 1;
//             Scheduler.Worker worker = scheduler.createWorker();
//             subscriber.add(worker); // not scheduling after unsubscribe
// 
//             for (final Recorded<T> notification: notifications) {
//                 worker.schedule(new Action0() {
//                     @Override
//                     public void call() {
//                         notification.value.accept(subscriber);
//                     }
//                 }, notification.time, TimeUnit.MILLISECONDS);
//             }
// 
//             subscriber.add((Subscriptions.create(new Action0() {
//                 @Override
//                 public void call() {
//                     // on unsubscribe
//                     observable.subscriptions.set(
//                             subscriptionIndex,
//                             new SubscriptionLog(subscriptionLog.subscribe, scheduler.now())
//                     );
//                 }
//             })));
//         }
//     }
// }
// 
// Path: src/main/java/rx/marble/MapHelper.java
// public static <V> Map<String, V> of(String k, V v) {
//     return Collections.singletonMap(k,v);
// }
// 
// Path: src/main/java/rx/marble/junit/MarbleRule.java
// public class MarbleRule implements TestRule {
// 
//     private static ThreadLocal<MarbleScheduler> schedulerHolder = new ThreadLocal<>();
// 
//     public final MarbleScheduler scheduler;
// 
//     public MarbleRule() {
//         scheduler = new MarbleScheduler();
//     }
// 
//     public MarbleRule(long frameTimeFactor) {
//         scheduler = new MarbleScheduler(frameTimeFactor);
//     }
// 
//     public static <T> HotObservable<T> hot(String marbles, Map<String, T> values) {
//         return schedulerHolder.get().createHotObservable(marbles, values);
//     }
// 
//     public static HotObservable<String> hot(String marbles) {
//         return schedulerHolder.get().createHotObservable(marbles);
//     }
// 
//     public static <T> ColdObservable<T> cold(String marbles, Map<String, T> values) {
//         return schedulerHolder.get().createColdObservable(marbles, values);
//     }
// 
//     public static ColdObservable<String> cold(String marbles) {
//         return schedulerHolder.get().createColdObservable(marbles);
//     }
// 
//     public static ISetupTest expectObservable(Observable<?> actual) {
//         return schedulerHolder.get().expectObservable(actual);
//     }
// 
//     public static ISetupTest expectObservable(Observable<?> actual, String unsubscriptionMarbles) {
//         return schedulerHolder.get().expectObservable(actual, unsubscriptionMarbles);
//     }
// 
//     public static ISetupSubscriptionsTest expectSubscriptions(List<SubscriptionLog> subscriptions) {
//         return schedulerHolder.get().expectSubscriptions(subscriptions);
//     }
// 
//     @Override
//     public Statement apply(final Statement base, Description description) {
//         return new Statement() {
//             @Override
//             public void evaluate() throws Throwable {
//                 schedulerHolder.set(scheduler);
//                 try {
//                     base.evaluate();
//                     scheduler.flush();
//                 } finally {
//                     schedulerHolder.remove();
//                 }
// 
//             }
//         };
//     }
// }


// Path: src/test/java/rx/marble/junit/DemoTest.java
import org.junit.Rule;
import org.junit.Test;
import rx.Observable;
import rx.functions.Func1;
import rx.functions.Func2;
import rx.marble.ColdObservable;
import java.util.Map;
import static rx.marble.MapHelper.of;
import static rx.marble.junit.MarbleRule.*;

package rx.marble.junit;





public class DemoTest {

    @Rule
    public MarbleRule marble = new MarbleRule();