public NodeState copy(NodeState node) {
        for (String key : node.state.keySet()) {
            state.put(key, node.state.get(key));
        }
        for (String key : node.children.keySet()) {
            getChild(key, true).copy(node.children.get(key));
        }
        return this;
    }
Copies the state content of another node state object into this.

@param node The node state to copy into this.
@return This, to allow chaining.
documentapi/src/main/java/com/yahoo/documentapi/messagebus/systemstate/rule/NodeState.java