protected function updateCopyOIDs(array $oidMap) {
    $registry = $this->getLocalSessionValue(self::OBJECT_MAP_VAR);
    // registry maybe deleted already if it's the last step
    if ($registry) {
      $flippedRegistry = array_flip($registry);
      foreach ($oidMap as $oldOid => $newOid) {
        if (isset($flippedRegistry[$oldOid])) {
          $key = $flippedRegistry[$oldOid];
          unset($flippedRegistry[$oldOid]);
          $flippedRegistry[$newOid] = $key;
        }
      }
      $registry = array_flip($flippedRegistry);
      $this->setLocalSessionValue(self::OBJECT_MAP_VAR, $registry);
    }
  }