public void reset(final int timeoutMs) {
        this.lock.lock();
        this.timeoutMs = timeoutMs;
        try {
            if (this.stopped) {
                return;
            }
            if (this.running) {
                schedule();
            }
        } finally {
            this.lock.unlock();
        }
    }
@Test
    public void testReset() throws Exception {
        this.timer.start();
        assertEquals(50, this.timer.getTimeoutMs());
        for (int i = 0; i < 10; i++) {
            Thread.sleep(80);
            this.timer.reset();
        }
        assertEquals(10, this.timer.counter.get(), 3);
        this.timer.reset(100);
        for (int i = 0; i < 10; i++) {
            Thread.sleep(80);
            this.timer.reset();
        }
        assertEquals(10, this.timer.counter.get(), 3);
    }