code: private int countOfMode(boolean data) {
          restartFromHead: for (;;) {
              int count = 0;
              for (Node p = head; p != null;) {
                  if (!p.isMatched()) {
                      if (p.isData != data)
                          return 0;
                      if (++count == Integer.MAX_VALUE)
                          break;  // @see Collection.size()
                  }
                  if (UNLINKED == (p = p.next))
                      continue restartFromHead;
              }
              return count;
          }
      }
docs: Traverses and counts unmatched nodes of the given mode.
  Used by methods size and getWaitingConsumerCount.