@SuppressWarnings("unchecked")
    public B traits(Collection<Trait> traitsToSet) {
        clearTraits();
        for (Trait trait : traitsToSet) {
            addTrait(trait);
        }
        return (B) this;
    }
Replace all traits in the builder.

@param traitsToSet Sequence of traits to set on the builder.
@return Returns the builder.
smithy-model/src/main/java/software/amazon/smithy/model/shapes/AbstractShapeBuilder.java