docs: final void cleanLocks() throws RepositoryException {
          // clean the session-scoped locks: unlock all the nodes and remove the lock tokens from the system area
          Set<String> cleanedTokens = lockManager.cleanLocks(session);
          if (lockTokens.isEmpty()) {
              return;
          }
          // clean all open-scoped locks created via this session
          for (String lockToken : lockTokens) {
              if (!cleanedTokens.contains(lockToken)) {
                  ModeShapeLock lock = lockManager.findLockByToken(lockToken);
                  if (lock == null) {
                      // there is no existing lock for this token (it must've been removed from somewhere else)
                      continue;
                  }
                  // this is an open-scoped lock created via this session for which we'll have to update the 'held' flag
                  if (!lockManager.setHeldBySession(session, lockToken, false)) {
                      // Generally not expected, because if the lock exists we can always change the lock-held value to false
                      // even when it is already false ...
                      throw new LockException(JcrI18n.invalidLockToken.text(lockToken));
                  }
              }
          }
          // always clean our internal map of tokens
          lockTokens.clear();
      }