code: public boolean canAddMixin(String mixinName) throws RepositoryException
     {
        checkValid();
  
        NodeTypeData type =
           session.getWorkspace().getNodeTypesHolder().getNodeType(
              locationFactory.parseJCRName(mixinName).getInternalName());
  
        if (type == null)
        {
           throw new NoSuchNodeTypeException("Nodetype not found (mixin) " + mixinName);
        }
  
        if (session.getWorkspace().getNodeTypesHolder().isNodeType(type.getName(), nodeData().getPrimaryTypeName(),
           nodeData().getMixinTypeNames()))
        {
           return false;
        }
  
        if (definition.isProtected())
        {
           return false;
        }
  
        if (!checkedOut())
        {
           return false;
        }
  
        if (!checkLocking())
        {
           return false;
        }
  
        return true;
     }
docs: {@inheritDoc}