public void flush() {
        while (!shortTermStorage.isEmpty()) {
            T oldestRecord = shortTermStorage.poll();
            outputMechanism.accept(oldestRecord);
        }
    }
@Test
    public void testFlush() {
        /**
         * Confirm all points are emitted in the proper order upon calling "flush"
         */
        Duration maxLag = Duration.ofMinutes(5);

        TimeOrderVerifyingConsumer consumer = new TimeOrderVerifyingConsumer();

        ApproximateTimeSorter<TimePojo> sorter = new ApproximateTimeSorter<>(
            maxLag,
            consumer
        );

        for (TimePojo commonPoint : testData()) {
            sorter.accept(commonPoint);
        }

        assertEquals(0, consumer.size());

        sorter.flush();

        assertEquals(9, consumer.size());
    }