@Test
public void shouldScheduleDelayedActionOnHandlerThread() {

    final Handler handler = mock(Handler.class);
    @SuppressWarnings("unchecked")
    final Action1<Inner> action = mock(Action1.class);
    Scheduler scheduler = new HandlerThreadScheduler(handler);
    scheduler.schedule(action, 1L, TimeUnit.SECONDS);
    // verify that we post to the given Handler
    ArgumentCaptor<Runnable> runnable = ArgumentCaptor.forClass(Runnable.class);
    verify(handler).postDelayed(runnable.capture(), eq(1000L));
    // verify that the given handler delegates to our action
    runnable.getValue().run();
    verify(action).call(any(Inner.class));
}