Parameterless nullsFirst and nullsLast and misc comparator combining functions.

This commit is contained in:
Ilya Gorbunov
2015-08-06 17:10:54 +03:00
parent 5a4e598ba7
commit 7d33599fc2
3 changed files with 131 additions and 13 deletions
@@ -584,7 +584,7 @@ class CollectionTest {
listOf("", "sort", "abc").let {
assertEquals(listOf("", "abc", "sort"), it.sortedBy { it.nonEmptyLength() })
assertEquals(listOf("sort", "abc", ""), it.sortedByDescending { it.nonEmptyLength() })
assertEquals(listOf("abc", "sort", ""), it.sortedWith(compareBy(nullsLast(compareBy<Int> {it})) { it.nonEmptyLength()}))
assertEquals(listOf("abc", "sort", ""), it.sortedWith(compareBy(nullsLast<Int>()) { it.nonEmptyLength()}))
}
}