title: How to use TestScheduler in RxJava
body: <p>How should I use RxJava's <code>TestScheduler</code>? I come from a .NET background but the <code>TestScheduler</code> in RxJava does not seem to work the same way as the test scheduler in .NET rx.</p>
  
  <p>Here is sample code that I want to test</p>
  
  <pre><code>Observable&lt;Long&gt; tick = Observable.interval(1, TimeUnit.SECONDS);
  contactsRepository.find(index)
    .buffer(MAX_CONTACTS_FETCH)
    .zipWith(tick, new Func2&lt;List&lt;ContactDto&gt;, Long, List&lt;ContactDto&gt;&gt;() {
      @Override
      public List&lt;ContactDto&gt; call(List&lt;ContactDto&gt; contactList, Long aLong) {
        return contactList;
      }
    }).subscribe()
  </code></pre>
  
  <p>I've tried:</p>
  
  <pre><code>subscribeOn(testScheduler)
  testScheduler.advanceTimeBy(2, TimeUnit.SECONDS);
  testScheduler.triggerActions();
  </code></pre>
  
  <p>with no luck.</p>