/** * Find the first league of each set and return pairs of * index to league name. Assumes that clubs are sorted by ascending league name. */ fun indexAgendaHeaders(agendaItems: List): List> { return agendaItems .mapIndexed { index, block -> index to block.clubLeague } .distinctBy { it.second } }