public Builder removeShape(ShapeId shapeId) {
            if (shapeMap.hasValue() && shapeMap.peek().containsKey(shapeId)) {
                Shape previous = shapeMap.peek().get(shapeId);
                shapeMap.get().remove(shapeId);

                // Automatically remove any members contained in the shape.
                for (MemberShape memberShape : previous.members()) {
                    shapeMap.get().remove(memberShape.getId());
                }
            }

            return this;
        }
Removes a shape from the builder by ID.

<p>Members of shapes are automatically removed when their
containing shape is removed.

@param shapeId Shape to remove.
@return Returns the builder.
smithy-model/src/main/java/software/amazon/smithy/model/Model.java