private MemberShape getRequiredMixinMember(AbstractShapeBuilder<?, ?> builder, String requiredMemberName) {
        Optional<MemberShape> memberOnBuilder = builder.getMember(requiredMemberName);
        if (memberOnBuilder.isPresent()) {
            return memberOnBuilder.get();
        }

        // Get the most recently introduced mixin member with the given name.
        MemberShape mostRecentMember = null;

        for (Shape shape : builder.getMixins().values()) {
            for (MemberShape member : shape.members()) {
                if (member.getMemberName().equals(requiredMemberName)) {
                    mostRecentMember = member;
                    break; // break to the next mixin shape.
                }
            }
        }

        if (mostRecentMember == null) {
            return null;
        }

        return MemberShape.builder()
                .id(getId().withMember(requiredMemberName))
                .target(mostRecentMember.getTarget())
                .source(getSourceLocation())
                .addMixin(mostRecentMember)
                .build();
    }
This class is package-private, which means that all subclasses of this
class must reside within the same package. Because of this, Shape is a
closed set of known concrete shape types.

@param builder Builder to extract values from.
@param expectMemberSegments True/false if the ID must have a member.
smithy-model/src/main/java/software/amazon/smithy/model/shapes/Shape.java