docs: void publish() {
          assert publishedFullRegistry != null : "Cannot write directly to main registry";
  
          writeLock.lock();
          try {
              if (!modified) {
                  return;
              }
              publishedFullRegistry.writeLock.lock();
              try {
                  publishedFullRegistry.clear(true);
                  copy(this, publishedFullRegistry);
                  pendingRemoveCapabilities.clear();
                  pendingRemoveRequirements.clear();
                  modified = false;
              } finally {
                  publishedFullRegistry.writeLock.unlock();
              }
          } finally {
              writeLock.unlock();
          }
      }