private SmithyCodeWriter writeOptionalIdList(String textBeforeList, Collection<ShapeId> shapeIds) {
            if (shapeIds.isEmpty()) {
                return this;
            }

            openBlock("$L: [", textBeforeList);
            shapeIds.stream().sorted().forEach(shapeId -> write("$I", shapeId));
            closeBlock("]");

            return this;
        }
Writes a possibly-empty list where each element is a shape id.

<p>If the list is empty, nothing is written.
smithy-model/src/main/java/software/amazon/smithy/model/shapes/SmithyIdlModelSerializer.java