code: public boolean registerTaskGroup(Object taskGroupId, int numTasks) {
          return taskKeyToLatch.
              putIfAbsent(taskGroupId, new CountDownLatch(numTasks)) == null;
      }
docs: Registers a new task group with the specified number of tasks to execute,
  or returns {@code false} if a task group with the same identifier has
  already been registered.  This identifier will remain valid in the queue
  until {@link #await(Object) await} has been called.
  
  @param taskGroupId an identifier to be associated with a group of tasks
  @param numTasks the number of tasks that will be eventually run as a part
  of this group.
  
  @returns {@code true} if a new task group was registered or {@code false}
  if a task group with the same identifier had already been
  registered.