@Test
public void testWaitingProcess() throws Exception {

    TestCB cb = new TestCB() {
        int i = 4;
        @Override
        protected Action process() throws Exception {
            processed++;
            if (i-- > 1) {
                scheduler.schedule(successTask, 50, TimeUnit.MILLISECONDS);
                return Action.SCHEDULED;
            }
            return Action.SUCCEEDED;
        }
    };
    cb.iterate();
    assertTrue(cb.waitForComplete());
    assertEquals(4, cb.processed);
}