code: public NodeIterator merge(String srcWorkspace, boolean bestEffort) throws UnsupportedRepositoryOperationException,
        NoSuchWorkspaceException, AccessDeniedException, MergeException, RepositoryException, InvalidItemStateException
     {
        checkValid();
  
        if (!session.getAccessManager().hasPermission(getACL(),
           new String[]{PermissionType.ADD_NODE, PermissionType.SET_PROPERTY}, session.getUserState().getIdentity()))
        {
           throw new AccessDeniedException("Access denied: checkin operation " + getPath() + " for: "
              + session.getUserID() + " item owner " + getACL().getOwner());
        }
  
        if (session.hasPendingChanges())
        {
           throw new InvalidItemStateException("Session has pending changes ");
        }
  
        Map<String, String> failed = new HashMap<String, String>();
  
        // get corresponding node
        SessionImpl corrSession =
           ((RepositoryImpl)session.getRepository()).internalLogin(session.getUserState(), srcWorkspace);
  
        ItemDataMergeVisitor visitor = new ItemDataMergeVisitor(this.session, corrSession, failed, bestEffort);
        this.nodeData().accept(visitor);
  
        SessionChangesLog changes = visitor.getMergeChanges();
  
        EntityCollection failedIter = createMergeFailed(failed, changes);
  
        if (changes.getSize() > 0)
        {
           dataManager.getTransactManager().save(changes);
        }
  
        return failedIter;
     }
docs: {@inheritDoc}