private void maybeUpdatePartitionEpoch(
        ShareGroupMember oldMember,
        ShareGroupMember newMember
    ) {
        maybeRemovePartitionEpoch(oldMember);
        addPartitionEpochs(newMember.assignedPartitions(), newMember.memberEpoch());
    }
Updates the partition epochs based on the old and the new member.

@param oldMember The old member.
@param newMember The new member.
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/modern/share/ShareGroup.java