private synchronized void addWaiter(long delayMs, Long period, KafkaFutureImpl<Long> waiter) {
            long timeMs = time.milliseconds();
            if (delayMs <= 0) {
                waiter.complete(timeMs);
            } else {
                long triggerTimeMs = timeMs + delayMs;
                List<AbstractMap.SimpleEntry<Long, KafkaFutureImpl<Long>>> futures =
                        waiters.computeIfAbsent(triggerTimeMs, k -> new ArrayList<>());
                futures.add(new AbstractMap.SimpleEntry<>(period, waiter));
            }
        }
Add a task with `delayMs` and optional period to the internal waiter.
When `delayMs` < 0, we immediately complete the waiter. Otherwise, we add the task metadata to the waiter and
onTimeUpdated will take care of execute and reschedule it when it reaches its scheduled timestamp.

@param delayMs Delay time in ms.
@param period  Scheduling period, null means no periodic.
@param waiter  A wrapper over a callable function.
clients/src/test/java/org/apache/kafka/common/security/oauthbearer/internals/secured/RefreshingHttpsJwksTest.java