protected final void validateMemberShapeIds() {
        for (MemberShape member : members()) {
            if (!member.getId().toString().startsWith(getId().toString())) {
                ShapeId expected = getId().withMember(member.getMemberName());
                throw new SourceException(String.format(
                        "Expected the `%s` member of `%s` to have an ID of `%s` but found `%s`",
                        member.getMemberName(),
                        getId(),
                        expected,
                        member.getId()), getSourceLocation());
            }
        }
    }
Validates that a shape ID has or does not have a member.

@param expectMember Whether or not a member is expected.
smithy-model/src/main/java/software/amazon/smithy/model/shapes/Shape.java