@Override
        @SuppressWarnings("unchecked")
        public Node serialize(Map value, Set<Object> serializedObjects, NodeMapper mapper) {
            Map<StringNode, Node> mappings = new LinkedHashMap<>();
            Set<Map.Entry<Object, Object>> entries = (Set<Map.Entry<Object, Object>>) value.entrySet();

            // Iterate over the map entries and populate map entries for an ObjectNode.
            for (Map.Entry<Object, Object> entry : entries) {
                // Serialize the key and require that it is serialized as a StringNode.
                Node key = mapper.serialize(entry.getKey(), serializedObjects);
                if (key instanceof StringNode) {
                    mappings.put((StringNode) key, mapper.serialize(entry.getValue(), serializedObjects));
                } else {
                    throw new NodeSerializationException(
                            "Unable to write Map key because it was not serialized as a string: "
                                    + entry.getKey() + " -> " + Node.printJson(key));
                }
            }

            return new ObjectNode(mappings, SourceLocation.NONE);
        }
The default implementations use to convert Objects to Node values in {@link NodeMapper}.
smithy-model/src/main/java/software/amazon/smithy/model/node/DefaultNodeSerializers.java