public int sleepAndExecute()
    {
        long timeout = timeout();
        while (timeout > 0) {
            ZMQ.msleep(timeout);
            timeout = timeout();
        }
        return execute();
    }
@Test
    public void testInvokedAfterReset()
    {
        testNotInvokedAfterResetHalfTime();

        // Wait until the end
        int rc = timers.sleepAndExecute();
        assertThat(rc, is(1));
        assertThat(invoked.get(), is(true));
    }