code: public long getHighestDeliverable() {
          HighestDeliverable visitor=new HighestDeliverable();
          lock.lock();
          try {
              forEach(hd+1, hr, visitor);
              long retval=visitor.getResult();
              return retval == -1? hd : retval;
          }
          finally {
              lock.unlock();
          }
      }
docs: Returns the highest deliverable (= removable) seqno. This may be higher than {@link #getHighestDelivered()},
  e.g. if elements have been added but not yet removed