public void clear() {
        synchronized (this) {
            tasks.clear();
        }
    }
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