public void tick() {
        long now = time.milliseconds();
        Optional<MockTask> currentTask;
        /* pop and execute the task with the lowest next execution time if ready */
        do {
            currentTask = poll(t -> t.nextExecution() <= now);
            currentTask.ifPresent(t -> {
                t.task.run();
                /* if the task is periodic, reschedule it and re-enqueue */
                if (t.rescheduleIfPeriodic())
                    add(t);
            });
        } while (currentTask.isPresent());
    }
Check for any tasks that need to execute. Since this is a mock scheduler this check only occurs
when this method is called and the execution happens synchronously in the calling thread.
If you are using the scheduler associated with a MockTime instance this call be triggered automatically.
server-common/src/test/java/org/apache/kafka/server/util/MockScheduler.java