docs: public boolean isDerivedFrom( String[] testTypeNames,
                                    String primaryTypeName,
                                    String[] mixinNames ) throws RepositoryException {
          CheckArg.isNotEmpty(testTypeNames, "testTypeNames");
          CheckArg.isNotEmpty(primaryTypeName, "primaryTypeName");
  
          NameFactory nameFactory = context().getValueFactories().getNameFactory();
          Name[] typeNames = nameFactory.create(testTypeNames);
  
          // first check primary type
          for (Name typeName : typeNames) {
              JcrNodeType nodeType = getNodeType(typeName);
  
              if ((nodeType != null) && nodeType.isNodeType(primaryTypeName)) {
                  return true;
              }
          }
  
          // now check mixins
          if (mixinNames != null) {
              for (String mixin : mixinNames) {
                  for (Name typeName : typeNames) {
                      JcrNodeType nodeType = getNodeType(typeName);
  
                      if ((nodeType != null) && nodeType.isNodeType(mixin)) {
                          return true;
                      }
                  }
              }
          }
  
          return false;
      }