docs: public Token removeFirst(Transaction transaction)
                      throws ObjectManagerException {
          final String methodName = "removeFirst";
          if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
              trace.entry(this, cclass, methodName, new Object[] { transaction });
  
          // The true head of the combined subLists. This is the link at
          // the head of a subList with the largest sequenceNumber.
          ConcurrentSubList.Link firstLink = null;
          Token tokenToReturn = null;
  
          // The search is conducted in two phases.
          // 1) Look at the list indicated by the headSequenceNumber, in the hope that
          // we can avoid
          //    locking and searching all of the subLists.
          // 2) Look at all of the subLists for an unlocked Link or a Link locked by
          // our transaction,
          //    also correct the headSequenceNumber as we do this.
          //    The headSequenceNumber may have falen behind due to a message being
          // removed by some
          //    other method such as remove(Object,transaction) or the producer backed
          // out leaving a gap.
  
          ConcurrentSubList subListForRemoval = null;
  
          synchronized (headSequenceNumberLock) {
              // Capture the ObjectManagers unlock sequence number. Anything unlocked after 
              // this will not count. The next line delimits the point before which additions to 
              // list must committed and unlocked.
              long unlockPoint = getTransactionUnlockSequence();
              // Phase 1.
              // --------
              // Try deletetion of an unlocked message based on the predicted subList.
  
              subListForRemoval = getSublist(headSequenceNumber);
              synchronized (subListForRemoval) { // Look at the target subList.
  
                  firstLink = (ConcurrentSubList.Link) subListForRemoval.nextLink(null,
                                                                                  transaction,
                                                                                  unlockPoint);
                  //       firstLink =
                  // (ConcurrentSubList.Link)subListForRemoval.firstAvailableLink();
  
                  if (firstLink != null) { // See if an available link was found.
                      // See if it is the link we expected.
                      if (firstLink.sequenceNumber == headSequenceNumber) {
                          firstLink.requestDelete(transaction);// Mark for deletion.
                          // If the link is available to all adjust list visible length available.
                          // In the case where we delete a link added by the same transaction we have no incremented 
                          // the available size yet because we have not yet committed so we would not decrement it.
                          if (!firstLink.isLocked())
                              subListForRemoval.decrementAvailableSize();
  
                          incrementHeadSequenceNumber(firstLink); // Update the
                                                                  // headSequenceNumber.
                          // Assign the tokenToReturn while we have the subList locked so that the ObjectManager 
                          // cannot backout this transaction and remove the link under another transaction 
                          // causing this thread to see a null Token as a return value.
                          tokenToReturn = firstLink.data;
                      } else { // Not the sequence number we were expecting.
                          firstLink = null; // No use then, do a full search.
                      } // if (firstLink.sequenceNumber == headSequenceNumber).
                  } // if (firstLink != null).
              } // synchronized (subListForRemoval).
  
              if (firstLink == null) {
  
                  // Stop new additions while we work out the true head and tail of
                  // the list.
                  tailSequenceNumberLock.lock();
                  try {
                      // Check to see if the overall list is empty. We delay this test until
                      // now because we have to lock the tail sequence number to do this.
                      // The headSequenceNumber is advanced after removal from the head, so that it refers
                      // to the next sequence we will remove. TailSequence 
                      // refers to the last one we added and has not been advanced yet.
                      if (headSequenceNumber == tailSequenceNumber + 1) {
                          throw new java.util.NoSuchElementException();
                      } else { // Prepare to reset the headSequenceNumber.
                          if (!tailSequenceNumberSet)
                              resetTailSequenceNumber();
                          headSequenceNumber = tailSequenceNumber + 1;
                      } // if (headSequenceNumber == tailSequenceNumber+1).
  
                      // Phase 2.
                      // --------
                      // Nothing found so far, possibly for one of the following reasons:
                      // 1) The message indicated by headSequenceNumber had been removed by
                      //    another method (eg. remove())
                      // 2) It was backed out without being added.
                      // 3) We skipped ahead previously and now the message nearer the head
                      // has
                      //    completed its commit.
                      // 4) We need to look deeper into each list for messages locked by our
                      // transaction.
  
                      // Set up for a search of any message available to our transaction.
                      long fullSearchHeadSequenceNumber = Long.MAX_VALUE;
  
                      // Search for the list that contains the firstLink.
                      for (int i = 0; i < subLists.length; i++) {
                          synchronized (subLists[i]) {
                              // Continue setting the fullSearchHeadSequenceNumber for the
                              // specified transaction.
                              ConcurrentSubList.Link first = (ConcurrentSubList.Link) subLists[i].nextLink(null,
                                                                                                           transaction,
                                                                                                           unlockPoint);
                              if (first != null) { // Is there a first element?
                                  if (first.sequenceNumber < fullSearchHeadSequenceNumber) {
                                      fullSearchHeadSequenceNumber = first.sequenceNumber;
                                      subListForRemoval = subLists[i];
                                      firstLink = first;
  
                                      // Assign the tokenToReturn while we have the subList locked so that the ObjectManager 
                                      // cannot backout this transaction and remove the link under anoy=ther transaction 
                                      // causing this thread to see a null Token as a return value.
                                      tokenToReturn = firstLink.data;
                                  } // if (first.sequenceNumber < headSequenceNumber).
                              } // if (first != null).
  
                              // nextLink() skipped over anything that was toBeAdded for another
                              // transaction however these links
                              // are still eligible for the headSequenceNumber, so look again.
                              ConcurrentSubList.Link head = (ConcurrentSubList.Link) subLists[i].firstAvailableLink();
                              if (head != null) {
                                  headSequenceNumber = Math.min(headSequenceNumber,
                                                                head.sequenceNumber);
                              } // if (head != null).
                          } // synchronized (subLists[i]).
                      } // for subLists.
                  } finally {
                      if (tailSequenceNumberLock.isHeldByCurrentThread())
                          tailSequenceNumberLock.unlock();
                  } // try (tailSequenceNumberLock).
  
                  if (firstLink == null) { // Was an overallFirst found?
                      java.util.NoSuchElementException exception = new java.util.NoSuchElementException();
                      if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
                          trace.exit(this, cclass, methodName, exception);
                      throw exception;
  
                  } else {
                      // A suitable link was found.
                      // We have released the synchronize lock on the subLists, but we still
                      // hold the lock on the headSequenceNumber so no other thread can mark any of
                      // the Links, take the lock on the relevant subList again so that we can mark 
                      // it for update.
                      // It is not possible for a caller of remove(Object) to steal our link because we hold the 
                      // headSequenceNumber lock.
                      synchronized (subListForRemoval) {
                          firstLink.requestDelete(transaction);// Mark for deletion.
                          // If the link is available to all adjust list visible length available.
                          // In the case where we delete a link added by the same transaction we have no incremented 
                          // the available size yet because we have not yet committed so we would not decrement it.
                          if (!firstLink.isLocked())
                              subListForRemoval.decrementAvailableSize();
  
                          // Update the headSequenceNumber, if it is the head of the overall
                          // list.
                          if (firstLink.sequenceNumber == headSequenceNumber) {
                              incrementHeadSequenceNumber(firstLink);
                          } // if ( firstLink.sequenceNumber == headSequenceNumber ).
                      } // synchronized (subListForRemoval).
                      if (LinkedList.gatherStatistics)
                          removeFirstFullSearchCount++;
                  } // if (firstLink == null).
  
              } // if (firstLink == null).
              else if (LinkedList.gatherStatistics)
                  removeFirstPredictedSubListCount++;
          } // synchronized (headSequenceNumberLock).
  
          // We can release the synchronize lock on the list because we don't care if the
          // link which we are going to delete is changed before we write the log record.
          // Anyhow it is now marked as ToBeDeleted.
          // Log what we intend to do. Reserve enough spare log space so that the eventual
          // optimistic replace that removes the link from the list is certain to succeed
          // in being written as well.
          try {
              transaction.delete(firstLink,
                                 ConcurrentSubList.logSpaceForDelete());
  
          } catch (LogFileFullException exception) {
              // No FFDC Code Needed, transaction.delete() has already done this.
              firstLink.unRemove(this);
              if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
                  trace.exit(this, cclass, methodName, exception);
              throw exception;
  
              // We should not see ObjectStoreFullException because we have preReserved 
              // the ObjectStore space.
  //    } catch (ObjectStoreFullException exception) {
  //      // No FFDC Code Needed, transaction.delete() has already done this.
  //      firstLink.unRemove(this);
  //      if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
  //        trace.exit(this, cclass, methodName, exception);
  //      throw exception;
  
          } catch (InvalidStateException exception) {
              // No FFDC Code Needed.
              ObjectManager.ffdc.processException(this, cclass, methodName, exception, "1:793:1.26");
              firstLink.unRemove(this);
              if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
                  trace.exit(this, cclass, methodName, exception);
              throw exception;
          } // try.
  
          if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
              trace.exit(this, cclass, methodName, new Object[] { tokenToReturn });
          return tokenToReturn;
      }