public Set<Shape> getShapesWithTrait(ToShapeId trait) {
        Map<ShapeId, Set<Shape>> mappings = getTraitCache().traitIdsToShapes;
        return Collections.unmodifiableSet(mappings.getOrDefault(trait.toShapeId(), Collections.emptySet()));
    }
Gets a set of shapes in the model marked with a specific trait.

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