public <T> ScheduledFuture<T> schedule(final Callable<T> callable, long delayMs, Long period) {

            KafkaFutureImpl<Long> waiter = new KafkaFutureImpl<>();
            waiter.thenApply((KafkaFuture.BaseFunction<Long, Void>) now -> {
                try {
                    callable.call();
                } catch (Throwable e) {
                    e.printStackTrace();
                }
                return null;
            });
            addWaiter(delayMs, period, waiter);
            return null;
        }
Internal utility function for periodic or one time refreshes.

@param period null indicates one time refresh, otherwise it is periodic.
clients/src/test/java/org/apache/kafka/common/security/oauthbearer/internals/secured/RefreshingHttpsJwksTest.java