private CoordinatorResult<ConsumerGroupHeartbeatResponseData, CoordinatorRecord> consumerGroupStaticMemberGroupLeave(
        ConsumerGroup group,
        ConsumerGroupMember member
    ) {
        // We will write a member epoch of -2 for this departing static member.
        ConsumerGroupMember leavingStaticMember = new ConsumerGroupMember.Builder(member)
            .setMemberEpoch(LEAVE_GROUP_STATIC_MEMBER_EPOCH)
            .setPartitionsPendingRevocation(Collections.emptyMap())
            .build();

        return new CoordinatorResult<>(
            Collections.singletonList(newCurrentAssignmentRecord(group.groupId(), leavingStaticMember)),
            new ConsumerGroupHeartbeatResponseData()
                .setMemberId(member.memberId())
                .setMemberEpoch(LEAVE_GROUP_STATIC_MEMBER_EPOCH)
        );
    }
Handles the case when a static member decides to leave the group.
The member is not actually fenced from the group, and instead it's
member epoch is updated to -2 to reflect that a member using the given
instance id decided to leave the group and would be back within session
timeout.

@param group     The group.
@param member    The static member in the group for the instance id.

@return A CoordinatorResult with a single record signifying that the static member is leaving.
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupMetadataManager.java