@Override
    public Model onRemove(ModelTransformer transformer, Collection<Shape> shapes, Model model) {
        Set<Shape> toReplace = new HashSet<>();
        shapes.forEach(shape -> toReplace.addAll(getAffectedStructures(model, shape)));
        return transformer.replaceShapes(model, toReplace);
    }
Removes references to resources that are removed from
{@link ReferencesTrait}s.
smithy-model/src/main/java/software/amazon/smithy/model/transform/plugins/CleanResourceReferences.java