code: @SuppressWarnings({ "PMD.CollapsibleIfStatements",
          "PMD.GuardLogStatement" })
      public boolean awaitExhaustion(long timeout)
              throws InterruptedException {
          synchronized (this) {
              if (generators != null) {
                  if (running != generators.size()) {
                      generatorTracking.severe(
                          "Generator count doesn't match tracked.");
                  }
              }
              if (isExhausted()) {
                  return true;
              }
              if (generators != null) {
                  generatorTracking
                      .fine(() -> "Waiting, generators: " + generators.keySet());
              }
              wait(timeout);
              if (generators != null) {
                  generatorTracking
                      .fine(() -> "Waited, generators: " + generators.keySet());
              }
              return isExhausted();
          }
      }
docs: Await exhaustion with a timeout.
  
  @param timeout the timeout
  @return true, if successful
  @throws InterruptedException the interrupted exception