@Test
    public void testThrottle() throws Exception {
        MockTime time = new MockTime(0, 0, 0);
        ThrottleMock throttle = new ThrottleMock(time, 3);
        assertFalse(throttle.increment());
        assertEquals(0, time.milliseconds());
        assertFalse(throttle.increment());
        assertEquals(0, time.milliseconds());
        assertFalse(throttle.increment());
        assertEquals(0, time.milliseconds());
        assertTrue(throttle.increment());
        assertEquals(100, time.milliseconds());
        time.sleep(50);
        assertFalse(throttle.increment());
        assertEquals(150, time.milliseconds());
        assertFalse(throttle.increment());
        assertEquals(150, time.milliseconds());
        assertTrue(throttle.increment());
        assertEquals(200, time.milliseconds());
    }
ThrottleMock is a subclass of Throttle that uses a MockTime object.  It calls
MockTime#sleep instead of Object#wait.
trogdor/src/test/java/org/apache/kafka/trogdor/workload/ThrottleTest.java