@Override
    public boolean test(Collection<V> buffer) {
        if (buffer.size() >= this.batchSize) {
            this.nextDate();
            return true;
        }

        if (buffer.size() > 0 && this.next.isBefore(Instant.now())) {
            this.nextDate();
            return true;
        }

        return false;
    }
@Test
    public void testBySize() {
        HashMap<String, String> map = generateHashMap(99);

        assertFalse(trigger.test(map.values()));
        map.put("test", "b");
        assertTrue(trigger.test(map.values()));
    }