protected MemberShape[] getRequiredMembers(AbstractShapeBuilder<?, ?> builder, String... requiredMembersNames) {
        // Caller knows the order of provided member names, so we don't need a dynamic data structure.
        MemberShape[] members = new MemberShape[requiredMembersNames.length];
        int missingMemberCount = 0;

        for (int memberNameIndex = 0; memberNameIndex < requiredMembersNames.length; memberNameIndex++) {
            String requiredMemberName = requiredMembersNames[memberNameIndex];
            MemberShape member = getRequiredMixinMember(builder, requiredMemberName);
            if (member != null) {
                members[memberNameIndex] = member;
            } else {
                missingMemberCount++;
            }
        }

        if (missingMemberCount > 0) {
            List<String> missingMembers = new ArrayList<>();
            for (int memberIndex = 0; memberIndex < members.length; memberIndex++) {
                if (members[memberIndex] == null) {
                    missingMembers.add(requiredMembersNames[memberIndex]);
                }
            }
            throw missingRequiredMembersException(missingMembers);
        }

        return members;
    }
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