private void validateShapeCopiedFromMixin(Model model, Shape shape) {
        if (!shape.isMemberShape()) {
            return;
        }
        MemberShape memberShape = shape.asMemberShape().get();
        Shape container = model.getShape(memberShape.getContainer())
                .orElseThrow(() -> new ModelTransformException(
                        format("Cannot find the container shape for member `%s`.",
                                memberShape.getMemberName())));
        for (ShapeId mixinId : container.getMixins()) {
            Shape mixinShape = model.expectShape(mixinId);
            if (mixinShape.getMemberNames().contains(memberShape.getMemberName())
                    && !toRemove.contains(mixinShape)) {
                LOGGER.warning(format("Removing mixed in member `%s` from mixin shape `%s` "
                        + "in `%s` will result in an inconsistent model.",
                        memberShape.getMemberName(),
                        mixinShape.getId(),
                        container.getId().getName()));
            }
        }
    }
Removes shapes from a model while ensuring that relationships to/from
the shape are cleaned up.

<p>When a list, set, map, structure, or union are removed,
their member shapes are also removed.

<p><strong>Important</strong>: the removal of list, set, and map members
without removing their containers will leave the model in an inconsistent
state. The appropriate way to remove these shapes is to remove their
containing shape rather than the member.
smithy-model/src/main/java/software/amazon/smithy/model/transform/RemoveShapes.java