public void createClassicGroupRecords(
        MetadataVersion metadataVersion,
        List<CoordinatorRecord> records
    ) {
        Map<String, byte[]> assignments = new HashMap<>();
        allMembers().forEach(classicGroupMember ->
            assignments.put(classicGroupMember.memberId(), classicGroupMember.assignment())
        );

        records.add(CoordinatorRecordHelpers.newGroupMetadataRecord(this, assignments, metadataVersion));
    }
Populate the record list with the records needed to create the given classic group.

@param metadataVersion   The MetadataVersion.
@param records           The list to which the new records are added.
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/classic/ClassicGroup.java