protected void changeParent(CollectionNode newParent) {
        if (parent == newParent) {
            return;
        }

        getLogger().trace("Change parent to '{}'", newParent);

        if (parentIdentifier != null && newParent != null && !parentIdentifier.equals(newParent.getUniqueIdentifier())) {
            // FIXME: Remove this node from the parent when the parent isn't loaded. A previous commit message suggests
            //        that calling getParent() causes problems when the node is being initialized. OF-2402.
        }
        if (parent != null) {
            // Remove this node from the current parent node
            parent.removeChildNode(this);
        }
        // Set the new parent of this node
        parent = newParent;
        if (parent != null) {
            parentIdentifier = parent.getUniqueIdentifier();

            // Add this node to the new parent node
            parent.addChildNode(this);
        } else {
            parentIdentifier = null;
        }
        if (savedToDB) {
            XMPPServer.getInstance().getPubSubModule().getPersistenceProvider().updateNode(this);
        }
    }
Changes the parent node of this node. The node ID of the node will not be modified
based on the new parent so pubsub implementations where node ID has a semantic
meaning will end up affecting the meaning of the node hierarchy and possibly messing
up the meaning of the hierarchy.<p>

No notifications are sent due to the new parent adoption process.

@param newParent the new parent node of this node.
xmppserver/src/main/java/org/jivesoftware/openfire/pubsub/Node.java