code: public boolean isTypeOrSubtype( Name nodeTypeName,
                                      Name candidateSupertypeName ) {
          if (JcrNtLexicon.BASE.equals(candidateSupertypeName)) {
              // If the candidate is 'nt:base', then every node type is a subtype ...
              return true;
          }
          if (nodeTypeName.equals(candidateSupertypeName)) return true;
          JcrNodeType nodeType = getNodeType(nodeTypeName);
          return nodeType != null && nodeType.isNodeType(candidateSupertypeName);
      }
docs: Determine whether the node's given node type matches or extends the node type with the supplied name.
  
  @param nodeTypeName the name of the node type of a node; may not be null
  @param candidateSupertypeName the name of the potential supertype node type; may not be null
  @return true if the node type does extend or match the node type given by the supplied name, or false otherwise