public ShareGroupMember build() {
        // A new target assignment has been installed, we need to restart
        // the reconciliation loop from the beginning.
        if (targetAssignmentEpoch != member.memberEpoch()) {
            // We transition to the target epoch. The transition to the new state is done
            // when the member is updated.
            return new ShareGroupMember.Builder(member)
                .setState(MemberState.STABLE)
                .setAssignedPartitions(targetAssignment.partitions())
                .updateMemberEpoch(targetAssignmentEpoch)
                .build();
        }

        return member;
    }
Builds the next state for the member or keep the current one if it
is not possible to move forward with the current state.

@return A new ShareGroupMember or the current one.
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/modern/share/ShareGroupAssignmentBuilder.java