Repository: apache/kafka
File: group-coordinator/src/main/java/org/apache/kafka/coordinator/group/modern/share/ShareGroupMember.java (Java)

Code before:
          int previousMemberEpoch,
          String rackId,
          String clientId,
          String clientHost,
          Set<String> subscribedTopicNames,
          MemberState state,
          Map<Uuid, Set<Integer>> assignedPartitions
    ) {
        super(
            memberId,
            memberEpoch,
            previousMemberEpoch,
            null,
            rackId,
            clientId,
            clientHost,
            subscribedTopicNames,
            state
        );
        this.assignedPartitions = assignedPartitions;
    }

    /**
     * The partitions assigned to this member.
     */
    private final Map<Uuid, Set<Integer>> assignedPartitions;

    /**
     * @return The partitions assigned to this member.
     */
    public Map<Uuid, Set<Integer>> assignedPartitions() {
        return assignedPartitions;
    }

    /**
     * @return True if the two provided members have different assigned partitions.
     */
    public static boolean hasAssignedPartitionsChanged(
        ShareGroupMember member1,
        ShareGroupMember member2
    ) {
        return !member1.assignedPartitions().equals(member2.assignedPartitions());
    }

    /**
     * Converts this ShareGroupMember to a ShareGroupDescribeResponseData.Member.
     *
     * @param image : Topics image object to search for a specific topic id
     * @return The ShareGroupMember mapped as ShareGroupDescribeResponseData.Member.
     */
    public ShareGroupDescribeResponseData.Member asShareGroupDescribeMember(

Review comment (suggestion):
I think this declaration belongs in between the builder and constructor, like in `ConsumerGroupMember`.

Code after:
    private final Map<Uuid, Set<Integer>> assignedPartitions;

    private ShareGroupMember(
          String memberId,
          int memberEpoch,
          int previousMemberEpoch,
          String rackId,
          String clientId,
          String clientHost,
          Set<String> subscribedTopicNames,
          MemberState state,
          Map<Uuid, Set<Integer>> assignedPartitions
    ) {
        super(
            memberId,
            memberEpoch,
            previousMemberEpoch,
            null,
            rackId,
            clientId,
            clientHost,
            subscribedTopicNames,
            state
        );
        this.assignedPartitions = assignedPartitions;
    }

    /**
     * @return The partitions assigned to this member.
     */
    public Map<Uuid, Set<Integer>> assignedPartitions() {
        return assignedPartitions;
    }

    /**
     * @return True if the two provided members have different assigned partitions.
     */
    public static boolean hasAssignedPartitionsChanged(
        ShareGroupMember member1,
        ShareGroupMember member2
    ) {
        return !member1.assignedPartitions().equals(member2.assignedPartitions());
    }

    /**
     * Converts this ShareGroupMember to a ShareGroupDescribeResponseData.Member.
     *
     * @param image : Topics image object to search for a specific topic id
     * @return The ShareGroupMember mapped as ShareGroupDescribeResponseData.Member.
     */
    public ShareGroupDescribeResponseData.Member asShareGroupDescribeMember(