docs: public boolean destroyWorkspace( final String name,
                                       final WritableSessionCache removeSession ) {
          if (workspaceNames.contains(name)) {
              if (configuration.getPredefinedWorkspaceNames().contains(name)) {
                  throw new UnsupportedOperationException(JcrI18n.unableToDestroyPredefinedWorkspaceInRepository.text(name,
                                                                                                                      getName()));
              }
              if (configuration.getDefaultWorkspaceName().equals(name)) {
                  throw new UnsupportedOperationException(JcrI18n.unableToDestroyDefaultWorkspaceInRepository.text(name, getName()));
              }
              if (this.systemWorkspaceName.equals(name)) {
                  throw new UnsupportedOperationException(JcrI18n.unableToDestroySystemWorkspaceInRepository.text(name, getName()));
              }
              if (!configuration.isCreatingWorkspacesAllowed()) {
                  throw new UnsupportedOperationException(JcrI18n.creatingWorkspacesIsNotAllowedInRepository.text(getName()));
              }
              // persist *all* the changes in one unit, because in case of failure we need to remain in consistent state
              localStore().runInTransaction(() -> {
                  // unlink the system node
                  removeSession.mutable(removeSession.getRootKey()).removeChild(removeSession, getSystemKey());
                  // remove the workspace and persist it
                  RepositoryCache.this.workspaceNames.remove(name);
                  refreshRepositoryMetadata(true);
                  // persist the active changes in the session
                  removeSession.save();
  
                  return null;
              }, 0);
  
              // And notify the others - this notification will clear & close the WS cache via the local listener
              String userId = context.getSecurityContext().getUserName();
              Map<String, String> userData = context.getData();
              DateTime timestamp = context.getValueFactories().getDateFactory().create();
              RecordingChanges changes = new RecordingChanges(context.getId(), context.getProcessId(), this.getKey(), null,
                                                              repositoryEnvironment.journalId());
              changes.workspaceRemoved(name);
              changes.freeze(userId, userData, timestamp);
              this.changeBus.notify(changes);
              return true;
          }
          return false;
      }