@Override
    public synchronized void onTimeUpdated() {
        long timeMs = time.milliseconds();
        while (true) {
            Map.Entry<Long, List<KafkaFutureImpl<Long>>> entry = waiters.firstEntry();
            if ((entry == null) || (entry.getKey() > timeMs)) {
                break;
            }
            for (KafkaFutureImpl<Long> future : entry.getValue()) {
                future.complete(timeMs);
            }
            waiters.remove(entry.getKey());
        }
    }
Futures which are waiting for a specified wall-clock time to arrive.
clients/src/test/java/org/apache/kafka/common/utils/MockScheduler.java