code: public final boolean isNodeType( Name nodeTypeName ) throws RepositoryException {
          checkSession();
          SessionCache cache = sessionCache();
          NodeTypes nodeTypes = session().nodeTypes();
          try {
              CachedNode node = node();
              // Check the primary type ...
              Name primaryTypeName = node.getPrimaryType(cache);
              if (nodeTypes.isTypeOrSubtype(primaryTypeName, nodeTypeName)) return true;
              // Check the mixins ...
              Set<Name> mixinTypes = node.getMixinTypes(cache);
              if (nodeTypes.isTypeOrSubtype(mixinTypes, nodeTypeName)) return true;
          } catch (ItemNotFoundException e) {
              // The node has been removed, so do nothing
          }
          return false;
      }
docs: Determine whether this node's primary type or any of the mixins are or extend the node type with the supplied name. This
  method is semantically equivalent to but slightly more efficient than the {@link #isNodeType(String) equivalent in the JCR
  API}, especially when the node type name is already a {@link Name} object.
  
  @param nodeTypeName the name of the node type
  @return true if this node is of the node type given by the supplied name, or false otherwise
  @throws RepositoryException if there is an exception