public Set<Shape> getShapesWithTrait(Class<? extends Trait> trait) {
        Map<Class<? extends Trait>, Set<Shape>> mappings = getTraitCache().traitsToShapes;
        return Collections.unmodifiableSet(mappings.getOrDefault(trait, Collections.emptySet()));
    }
Gets a set of shapes in the model marked with a specific trait.

<p>The result is an exact match on trait classes and does not utilize
any kind of polymorphic instance of checks.

@param trait Trait class to look for on shapes.
@return Returns the immutable set of matching shapes.
smithy-model/src/main/java/software/amazon/smithy/model/Model.java