public void maybeTriggerWakeup() {
        final AtomicBoolean throwWakeupException = new AtomicBoolean(false);
        pendingTask.getAndUpdate(task -> {
            if (task == null) {
                return null;
            } else if (task instanceof WakeupFuture) {
                throwWakeupException.set(true);
                return null;
            } else {
                return task;
            }
        });
        if (throwWakeupException.get()) {
            throw new WakeupException();
        }
    }
@Test
    public void testManualTriggerWhenWakeupNotCalled() {
        assertDoesNotThrow(() -> wakeupTrigger.maybeTriggerWakeup());
    }