copyHierarchy(excludeNode, includeState) {
        const nodes = [];
        let parents = this.getParents();

        // Remove old hierarchy data
        each(parents, node => {
            nodes.push(node.toObject(excludeNode, includeState));
        });

        parents = nodes.reverse();

        if (!excludeNode) {
            const clone = this.toObject(true, includeState);

            // Filter out hidden children
            if (this.hasChildren()) {
                clone.children = this.children.filterBy(n => !n.state('hidden')).toArray();

                clone.children._context = clone;
            }

            nodes.push(clone);
        }

        const hierarchy = nodes[0];
        const l = nodes.length;
        let pointer = hierarchy;
        each(nodes, (parent, key) => {
            const children = [];

            if (key + 1 < l) {
                children.push(nodes[key + 1]);
                pointer.children = children;

                pointer = pointer.children[0];
            }
        });

        return objectToNode(this._tree, hierarchy);
    }
Copy all parents of a node.

@param {boolean} excludeNode Exclude given node from hierarchy.
@param {boolean} includeState Include itree.state object.
@return {TreeNode} Root node object with hierarchy.