code: void add(final byte type, final Object value) {
      final int w = write.getAndIncrement();
  
      if (w < size) {
        writeAt(w, type, value);
      }
  
      // countdown could wrap around, however we check the state of finished in here.
      // MUST be called after write to make sure that results and states are synchronized.
      final int c = countdown.decrementAndGet();
  
      if (c < 0) {
        throw new IllegalStateException("already finished (countdown)");
      }
  
      // if this thread is not the last thread to check-in, do nothing..
      if (c != 0) {
        return;
      }
  
      // make sure this can only happen once.
      // This protects against countdown, and write wrapping around which should very rarely
      // happen.
      if (!done.compareAndSet(false, true)) {
        throw new IllegalStateException("already finished");
      }
  
      done(collect());
    }
docs: Checks in a doCall back. It also wraps up the group if all the callbacks have checked in.