@Test
@Timeout(value = 500, unit = TimeUnit.MILLISECONDS)
public void testAfterCancelled() throws InterruptedException, InvocationTargetException, ExecutionException {

    AtomicBoolean check = new AtomicBoolean();
    Callable<Boolean> callable = () -> check.getAndSet(true);
    ScheduledCompletableFuture<Boolean> after = scheduler.after(callable, Duration.ofMillis(200_0000));
    after.cancel(true);
    Thread.sleep(100);
    assertTrue(after.isCancelled(), "Scheduled job cancelled before timeout");
    Thread.sleep(200);
    assertFalse(check.get(), "Callable method should not been called");
    assertThrows(CancellationException.class, () -> after.get());
}