public void wakeOrSkipNextWait() {
    // Take early lock to avoid race-conditions. Lock is also taken in wake() (lock is re-entrant)
    synchronized (lock) {
      final boolean awoken = wake();
      if (!awoken) {
        LOG.debug("Waiter not waiting, instructing to skip next wait.");
        this.skipNextWait = true;
      }
    }
  }
@Test
  public void should_not_wait_if_instructed_to_skip_next()
      throws ExecutionException, InterruptedException {
    Waiter waiter = new Waiter(Duration.ofMillis(1000));
    waiter.wakeOrSkipNextWait(); // set skip
    Future<Long> waitTime = executor.submit(new WaitForWaiter(waiter));

    assertTrue(waitTime.get() < 100L, "Waited: " + waitTime.get());
  }