@VisibleForTesting internal fun List<HistoryHighlightInternal>.removeHighlightsAlreadyInGroups( historyMetadata: List<HistoryGroupInternal>, ): List<HistoryHighlightInternal> { return filterNot { highlight -> historyMetadata.any { it.groupItems.any { it.key.url == highlight.historyHighlight.url } } } }
Filter out highlights that are already part of a history group.