docs: @GuardedBy("minTopologyRecalculationLock")
     private void calculateMinTopologyId(int idOfRemovedTransaction) {
        minTopologyRecalculationLock.lock();
        try {
           // We should only need to re-calculate the minimum topology ID if the transaction being completed
           // has the same ID as the smallest known transaction ID, to check what the new smallest is.  We do this check
           // again here, since this is now within a synchronized method.
           if (idOfRemovedTransaction == -1 ||
                 (idOfRemovedTransaction == minTxTopologyId && idOfRemovedTransaction < currentTopologyId)) {
              int minTopologyIdFound = currentTopologyId;
  
              for (CacheTransaction ct : localTransactions.values()) {
                 int topologyId = ct.getTopologyId();
                 if (topologyId < minTopologyIdFound) minTopologyIdFound = topologyId;
              }
              for (CacheTransaction ct : remoteTransactions.values()) {
                 int topologyId = ct.getTopologyId();
                 if (topologyId < minTopologyIdFound) minTopologyIdFound = topologyId;
              }
              if (minTopologyIdFound != minTxTopologyId) {
                 if (trace) log.tracef("Changing minimum topology ID from %s to %s", minTxTopologyId, minTopologyIdFound);
                 minTxTopologyId = minTopologyIdFound;
              } else {
                 if (trace) log.tracef("Minimum topology ID still is %s; nothing to change", minTopologyIdFound);
              }
           }
        } finally {
           minTopologyRecalculationLock.unlock();
        }
     }