public Model removeUnreferencedTraitDefinitions(Model model, Predicate<Shape> keepFilter) {
        return removeShapes(model, new UnreferencedTraitDefinitions(keepFilter).compute(model));
    }
Removes trait definitions for traits that are not used by any shape
in the model.

<p>Trait definitions that are part of the prelude will not be removed.

@param model Model to transform
@param keepFilter Predicate function that accepts an unreferenced trait
 shape (that has the {@link TraitDefinition} trait) and returns true to
 remove the definition or false to keep the definition in the model.base.
@return Returns the transformed model.base.
smithy-model/src/main/java/software/amazon/smithy/model/transform/ModelTransformer.java