public static <T> Collector<T, Map<StringNode, Node>, ObjectNode> collect(
            Function<T, StringNode> keyMapper,
            Function<T, ToNode> valueMapper
    ) {
        return Collector.of(
                LinkedHashMap::new,
                (results, entry) -> results.put(keyMapper.apply(entry), valueMapper.apply(entry).toNode()),
                (left, right) -> {
                    left.putAll(right);
                    return left;
                },
                // Use the constructor that doesn't need to re-copy.
                results -> new ObjectNode(results, SourceLocation.NONE, false));
    }
Creates a collector that creates an ObjectNode.

@param keyMapper Key mapping function that returns a ToNode.
@param valueMapper Value mapping function that returns a ToNode.
@param <T> Type being collected over (e.g., Map.Entry, Pair, etc.).
@return Returns the created collector.
smithy-model/src/main/java/software/amazon/smithy/model/node/ObjectNode.java