code: public static boolean isDependency(Extension extension, String namespace)
      {
          boolean isDependency = false;
  
          if (namespace == null) {
              isDependency = extension.getProperty(PKEY_DEPENDENCY, false);
          } else {
              Object namespacesObject = extension.getProperty(PKEY_NAMESPACES);
  
              // RETRO-COMPATIBILITY: used to be a String collection with just the actual namespaces
              if (namespacesObject instanceof Map) {
                  Map<String, Object> installedNamespace =
                      ((Map<String, Map<String, Object>>) namespacesObject).get(namespace);
  
                  isDependency =
                      installedNamespace != null ? (installedNamespace.get(PKEY_NAMESPACES_DEPENDENCY) == Boolean.TRUE)
                          : isDependency(extension, null);
              } else {
                  isDependency = isDependency(extension, null);
              }
          }
  
          return isDependency;
      }
docs: Indicate if the extension as been installed as a dependency of another one.
  
  @param extension the extension
  @param namespace the namespace to look at, null indicate the root namespace
  @return true if the the extension has been installed only because it was a dependency of another extension
  @see InstalledExtension#isDependency(String)
  @since 8.2RC1