assertSorted

Creates a SortedKeyValueSequence from this sequence, asserting that elements are sorted by their key.

Example:

val sorted = sequenceOf(1 to "a", 2 to "b").assertSorted()

Return

A sorted sequence wrapper

Parameters

TKey

The type of keys in the sequence, must be comparable

TValue

The type of values in the sequence

sortOrder

The sort order to verify against (default: ASCENDING)