@Override
        public synchronized void onTimeUpdated() {
            long timeMs = time.milliseconds();
            while (true) {
                Map.Entry<Long, List<AbstractMap.SimpleEntry<Long, KafkaFutureImpl<Long>>>> entry = waiters.firstEntry();
                if ((entry == null) || (entry.getKey() > timeMs)) {
                    break;
                }
                for (AbstractMap.SimpleEntry<Long, KafkaFutureImpl<Long>> pair : entry.getValue()) {
                    pair.getValue().complete(timeMs);
                    if (pair.getKey() != null) {
                        addWaiter(entry.getKey() + pair.getKey(), pair.getKey(), pair.getValue());
                    }
                }
                waiters.remove(entry.getKey());
            }
        }
The actual execution and rescheduling logic. Check all internal tasks to see if any one reaches its next
execution point, call it and optionally reschedule it if it has a specified period.
clients/src/test/java/org/apache/kafka/common/security/oauthbearer/internals/secured/RefreshingHttpsJwksTest.java