public boolean isAllowable() {
        long now = System.currentTimeMillis();
        if (now > lastResetTime.get() + interval) {
            token.set(rate);
            lastResetTime.set(now);
        }

        return token.decrementAndGet() >= 0;
    }
@Test
    void testAccuracy() throws Exception {
        final int EXPECTED_RATE = 5;
        statItem = new StatItem("test", EXPECTED_RATE, 60_000L);
        for (int i = 1; i <= EXPECTED_RATE; i++) {
            assertTrue(statItem.isAllowable());
        }

        // Must block the 6th item
        assertFalse(statItem.isAllowable());
    }