private Map<ShapeId, Shape> getTraitShapes(Model model, ShapeId traitId, Map<ShapeId, Shape> traitShapes) {
        Optional<Shape> initialTraitShapeOp = model.getShape(traitId);
        if (initialTraitShapeOp.isPresent()) {
            Shape initialTraitShape = initialTraitShapeOp.get();
            traitShapes.put(traitId, initialTraitShape);
            for (ShapeId metaTraitId : initialTraitShape.getAllTraits().keySet()) {
                if (!metaTraitId.equals(TraitDefinition.ID) && !traitShapes.containsKey(metaTraitId)) {
                    traitShapes.putAll(getTraitShapes(model, metaTraitId, traitShapes));
                }
            }
        }
        return traitShapes;
    }
@param keepFilter Predicate that if matched keeps a trait definition from being unreferenced.
smithy-model/src/main/java/software/amazon/smithy/model/neighbor/UnreferencedTraitDefinitions.java