class WindowedEventCounter {

    public void setWindowMillis(long windowMillis) {
        if (windowMillis <= 0) {
            throw new IllegalArgumentException("windowMillis must be greater than 0");
        }

        // changing windowMillis while tally() is draining expired events could
        // lead to weirdness, let's lock for this.
        synchronized (queue) {
            this.windowMillis = windowMillis;
        }
    }

    public  WindowedEventCounter(int capacity, long windowMillis);

}