code: private void removeInstalledExtension(DefaultInstalledExtension installedExtension, String namespace)
      {
          removeInstalledFeature(installedExtension.getId().getId(), namespace);
  
          for (ExtensionId feature : installedExtension.getExtensionFeatures()) {
              removeInstalledFeature(feature.getId(), namespace);
          }
  
          removeFromBackwardDependencies(installedExtension, namespace);
  
          if (!installedExtension.isInstalled()) {
              removeCachedExtension(installedExtension);
          }
      }
docs: Uninstall provided extension.
  
  @param installedExtension the extension to uninstall
  @param namespace the namespace
  @see #uninstallExtension(LocalExtension, String)