Netflix/RxJava — pull request #642 by akarnokd (2013-12-19 14:46:45+00:00)
Title: TestScheduler infrastructure enhancements

Enhanced TestScheduler.

Mentioned in issue #634, and in the forum [HistoricalScheduler](https://groups.google.com/forum/#!topic/rxjava/4vmsg5Rs5sU).

Notes:
- Inspired by Rx.NET.
- ```HistoricalScheduler``` appears to be just a variant of the ```TestScheduler``` where times are absolute ```DateTimeOffset```s. Since we don't do ```java.util.Date``` overloads anywhere, I didn't implement this. If you need to work with real time (i.e., ```System.currentTimeMillis()```) just advance the ```TestScheduler``` by ctm. before doing anything else.
- The ```Recorded``` class, the ```TestScheduler.scheduleAbsolute``` and ```TestScheduler.scheduleRelative``` methods use millisecond resolution time due to two reasons:
- ```TestScheduler.now()``` is in milliseconds
- No real need of higher resolution, as TestScheduler operates on virtual time and aimed for testing purposes only. Virtual time can be scaled up or down as neccessary.
- Added the package ```rx.observers```. I guess we can move the ```SafeObserver```, ```ObserverBase``` and ```SynchronizedObserver``` into these packages (not done in this PR). The package's JavaDoc visibility can be decided independently.
- I put the new ```ColdObservable```, ```HotObservable``` and ```TestableObservable``` types into ```rx.observables```. Do we have a main distribution and a test distribution of RxJava (i.e., if someone wants to use these types to test his/her own operators, does he/she need to download a different library)?
- Added some behavior to ```Notification```. In addition, I suggested the deprecation of ```new Notification()``` to create an OnCompleted kind of notification, since virtually there is no way (or reason) to distinguish between one OnCompleted event from another, I've added a factory method instead which returns a single constant instance. I haven't changed any use place of the old constructor.
- See ```TestSchedulerTest``` for the use cases.