@Override
        @SuppressWarnings("unchecked")
        public B flattenMixins() {
            if (getMixins().isEmpty()) {
                return (B) this;
            }

            for (Shape mixin : getMixins().values()) {
                SourceLocation location = getSourceLocation();
                Collection<Trait> localTraits = Collections.emptyList();
                MemberShape mixinMember = ((CollectionShape) mixin).getMember();
                MemberShape existing = member;
                if (existing != null) {
                    localTraits = existing.getIntroducedTraits().values();
                    location = existing.getSourceLocation();
                }
                member = MemberShape.builder()
                        .id(getId().withMember(mixinMember.getMemberName()))
                        .target(mixinMember.getTarget())
                        .addTraits(mixinMember.getAllTraits().values())
                        .addTraits(localTraits)
                        .source(location)
                        .build();
            }
            return super.flattenMixins();
        }
Sets the member of the collection.

@param target Target of the member.
@param memberUpdater Consumer that can update the created member shape.
@return Returns the builder.
smithy-model/src/main/java/software/amazon/smithy/model/shapes/CollectionShape.java