public <T extends ToNode> ObjectNode withMember(StringNode key, T value) {
        Map<StringNode, Node> nodeMapCopy = new LinkedHashMap<>(nodeMap);
        nodeMapCopy.put(Objects.requireNonNull(key), Objects.requireNonNull(value).toNode());
        // Use the constructor that doesn't re-copy.
        return new ObjectNode(nodeMapCopy, getSourceLocation(), false);
    }
Constructs a new object node with the given member added.

@param key Name of the member to add.
@param <T> Type of the value member to add.
@param value Value of the member to add.
@return Returns a new object node.
smithy-model/src/main/java/software/amazon/smithy/model/node/ObjectNode.java