@Test
public void testSyncMaxConcurrent() {

    TestScheduler tSched = new TestScheduler();
    SchedulerWhen sched = maxConcurrentScheduler(tSched);
    TestSubscriber<Long> tSub = TestSubscriber.create();
    syncWork(sched).subscribe(tSub);
    tSub.assertValueCount(0);
    tSched.advanceTimeBy(0, SECONDS);
    // since all the work is synchronous nothing is blocked and its all done
    tSub.assertValueCount(5);
    tSub.assertComplete();
    sched.dispose();
}