@@ -0,0 +1,1660 @@
+package com.github.phantomthief.test;%0A%0Aimport static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;%0Aimport static java.util.concurrent.TimeUnit.SECONDS;%0Aimport static org.junit.jupiter.api.Assertions.assertEquals;%0A%0Aimport java.util.concurrent.atomic.AtomicInteger;%0A%0Aimport org.junit.jupiter.api.Test;%0Aimport org.slf4j.Logger;%0Aimport org.slf4j.LoggerFactory;%0A%0Aimport com.github.phantomthief.collection.BufferTrigger;%0A%0A/**%0A * @author w.vela%0A * Created on 2021-01-29.%0A */%0Aclass DynamicIntervalTest %7B%0A    private static final Logger logger = LoggerFactory.getLogger(DynamicIntervalTest.class);%0A%0A    @Test%0A    void test() %7B%0A        int%5B%5D interval = %7B2%7D;%0A        AtomicInteger counter = new AtomicInteger();%0A        BufferTrigger%3CString%3E buffer = BufferTrigger.%3CString, Integer%3E simple()%0A                .setContainer(() -%3E 0, (_1, _2) -%3E true)%0A                .consumer(it -%3E %7B%0A                    logger.info(%22before consumer:%7B%7D%22, counter);%0A                    counter.incrementAndGet();%0A                    logger.info(%22after consumer:%7B%7D%22, counter);%0A                %7D)%0A                .interval(() -%3E interval%5B0%5D, SECONDS)%0A                .build();%0A%0A        int current = counter.get();%0A        for (int i = 0; i %3C 5; i++) %7B%0A            buffer.enqueue(%22test%22);%0A            sleepUninterruptibly(interval%5B0%5D, SECONDS);%0A            assertEquals(current++, counter.get());%0A        %7D%0A        interval%5B0%5D = 3;%0A        current = counter.get();%0A        for (int i = 0; i %3C 5; i++) %7B%0A            buffer.enqueue(%22test%22);%0A            sleepUninterruptibly(interval%5B0%5D, SECONDS);%0A            assertEquals(current++, counter.get());%0A        %7D%0A    %7D%0A%7D%0A

add test case for dynamic interval.