private TraitCache getTraitCache() {
        TraitCache cache = traitCache;
        if (cache == null) {
            synchronized (this) {
                cache = traitCache;
                if (cache == null) {
                    traitCache = cache = new TraitCache(this.shapeMap.values());
                }
            }
        }
        return cache;
    }
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