@Override
    public Void listShape(ListShape shape) {
        writer.write("$L.expectArrayNode()", varName);
        writer.indent();
        writer.writeWithNoFormatting(".getElements().stream()");
        String argName = "n" + (nestedLevel > 0 ? Integer.toString(nestedLevel) : "");
        writer.write(".map($L -> $C)",
                argName,
                (Runnable) () -> shape.getMember()
                        .accept(new FromNodeMapperVisitor(writer,
                                model,
                                argName,
                                nestedLevel + 1)));
        if (nestedLevel == 0) { // Triggered when shape is a member.
            writer.writeWithNoFormatting(".forEach(builder::addValues);");
        } else { // Triggered when shape is nested.
            writer.write(".collect($T.toList())", Collectors.class);
        }
        writer.dedent();
        return null;
    }
Determines how to map a node to a shape.
smithy-trait-codegen/src/main/java/software/amazon/smithy/traitcodegen/generators/FromNodeMapperVisitor.java