code: public void awaitCount(long totalCount) throws InterruptedException
    {
      checkTotalCount(totalCount);
      long currentCount = sync.getCount();
      while (compareCounts(totalCount, currentCount) > 0) {
        sync.acquireSharedInterruptibly(currentCount);
        currentCount = sync.getCount();
      }
    }
docs: Await until the {@link #increment} is called on this counter object the specified number of times from the creation
  of this counter object.