public void setCurrentTimeMs(long newMs) {
        long oldMs = timeMs.getAndSet(newMs);

        // does not allow to set to an older timestamp
        if (oldMs > newMs)
            throw new IllegalArgumentException("Setting the time to " + newMs + " while current time " + oldMs + " is newer; this is not allowed");

        highResTimeNs.set(TimeUnit.MILLISECONDS.toNanos(newMs));
        tick();
    }
Listeners which are waiting for time changes.
s3stream/src/main/java/com/automq/stream/utils/MockTime.java