code: public boolean await(Object taskGroupId, long timeout, TimeUnit unit) {
          CountDownLatch latch = taskKeyToLatch.get(taskGroupId);
          if (latch == null)
              throw new IllegalArgumentException(
                  "Unknown task group: " + taskGroupId);
          try {
              if (latch.await(timeout, unit)) {
                  // Once finished, remove the key so it can be associated with a
                  // new task
                  taskKeyToLatch.remove(taskGroupId);
                  return true;
              }
              return false;
          }
          catch (InterruptedException ie) {
              throw new IllegalStateException("Not all tasks finished", ie);
          }
      }
docs: Waits until all the tasks associated with the group identifier have
  finished.  Once a task group has been successfully waited upon, the group
  identifier is removed from the queue and is valid to be reused for a new
  task group.
  
  @throws IllegalArgumentException if the {@code taskGroupId} is not
  currently associated with any active taskGroup