private List<Shape> determineShapesToUpdate(Model model, Set<ShapeId> removedTraits) {
        List<Shape> shapes = model.shapes()
                .filter(shape -> !removedTraits.contains(shape.getId()))
                .filter(shape -> isShapeInNeedOfUpdate(shape, removedTraits))
                .map(shape -> removeTraitsFromShape(shape, removedTraits))
                .collect(Collectors.toList());

        if (!shapes.isEmpty()) {
            LOGGER.fine(() -> String.format(
                    "Replacing shapes %s that need the following traits removed: %s",
                    shapes,
                    removedTraits));
        }

        return shapes;
    }
Removes traits from shapes when trait definitions are removed.
smithy-model/src/main/java/software/amazon/smithy/model/transform/plugins/RemoveTraits.java