public CoordinatorResult<HeartbeatResponseData, CoordinatorRecord> classicGroupHeartbeat(
        RequestContext context,
        HeartbeatRequestData request
    ) {
        Group group;
        try {
            group = group(request.groupId());
        } catch (GroupIdNotFoundException e) {
            throw new UnknownMemberIdException(
                String.format("Group %s not found.", request.groupId())
            );
        }

        if (group.type() == CLASSIC) {
            return classicGroupHeartbeatToClassicGroup((ClassicGroup) group, context, request);
        } else {
            return classicGroupHeartbeatToConsumerGroup((ConsumerGroup) group, context, request);
        }
    }
Handle a classic group HeartbeatRequest.

@param context        The request context.
@param request        The actual Heartbeat request.

@return The coordinator result that contains the heartbeat response.
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupMetadataManager.java