@Test
@Timeout(value = 1, unit = TimeUnit.SECONDS)
public void testSchedule() throws InterruptedException {

    Semaphore s = new Semaphore(0);
    TestSchedulerTemporalAdjuster temporalAdjuster = new TestSchedulerTemporalAdjuster();
    scheduler.schedule(s::release, temporalAdjuster);
    s.acquire(3);
    Thread.sleep(300); // wait a little longer to see if not more are scheduled.
    assertEquals(0, s.availablePermits(), "Scheduler should not have released more after done");
    assertEquals(3, temporalAdjuster.getCount(), "Scheduler should have run 3 times");
}