@Test(timeout = 1000)
public void runnableDisposedAsyncTimed() throws Exception {

    final Scheduler s = Schedulers.single();
    Disposable d = s.scheduleDirect(Functions.EMPTY_RUNNABLE, 1, TimeUnit.MILLISECONDS);
    while (!d.isDisposed()) {
        Thread.sleep(1);
    }
}