private boolean maybeDeleteEmptyClassicGroup(Group group, List<CoordinatorRecord> records) {
        if (isEmptyClassicGroup(group)) {
            // Delete the classic group by adding tombstones.
            // There's no need to remove the group as the replay of tombstones removes it.
            if (group != null) createGroupTombstoneRecords(group, records);
            return true;
        }
        return false;
    }
Write tombstones for the group if it's empty and is a classic group.

@param group     The group to be deleted.
@param records   The list of records to delete the group.

@return true if the group is empty
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupMetadataManager.java