code: public long size(Transaction transaction)
                      throws ObjectManagerException
      {
          if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
              trace.entry(this, cclass,
                          "size",
                          new Object[] { transaction });
  
          long listLength; // For return;
  
          synchronized (this) {
              synchronized (availableSizeLock) {
                  listLength = availableSize;
              } // synchronized (availableSizeLock).
  
              if (transaction != null) {
                  Token nextToken = head;
                  // Add links ToBeAdded within the transaction.
                  while (nextToken != null) {
                      Link nextLink = (Link) nextToken.getManagedObject();
                      if (nextLink.state == Link.stateToBeAdded
                          && nextLink.lockedBy(transaction))
                          listLength++;
                      nextToken = nextLink.next;
                  } // while (nextToken != null).
              } // if (transaction != null)
          } // synchronized (this).
  
          if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
              trace.exit(this, cclass,
                         "size",
                         "returns listLength=" + listLength + "(long)");
          return listLength;
      }
docs: /*
  (non-Javadoc)
  
  @see com.ibm.ws.objectManager.Collection#size(com.ibm.ws.objectManager.Transaction)