@Override
    public long getDelay(TimeUnit unit) {
        return unit.convert(Math.max(getExpiration() - time.hiResClockMs(), 0), TimeUnit.MILLISECONDS);
    }
@Test
    public void testGetDelay() {
        MockTime time = new MockTime();
        TimerTaskList list = new TimerTaskList(new AtomicInteger(0), time);
        list.setExpiration(time.hiResClockMs() + 10000L);
        time.sleep(5000L);
        assertEquals(5L, list.getDelay(TimeUnit.SECONDS));
    }