code: 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;
      }
docs: Determine if any of the test type names are equal to or have been derived from the primary type or any of the mixins.
  
  @param testTypeNames the names of the types or mixins being tested against (never <code>null</code>)
  @param primaryTypeName the primary type name (never <code>null</code>)
  @param mixinNames the mixin names (may be <code>null</code>)
  @return <code>true</code> if at least one test type name is equal to or derived from the primary type or one of the mixins
  @throws RepositoryException if there is an exception obtaining node types
  @throws IllegalArgumentException if <code>testTypeNames</code> is <code>null</code> or empty or if
  <code>primaryTypeName</code> is <code>null</code> or zero length