Provide minWith and maxWith to find maximum and minimum values according to the given comparator.

#KT-9002 Fixed
This commit is contained in:
Ilya Gorbunov
2015-11-30 19:57:42 +03:00
parent b5e637bed5
commit 055c71e8d0
11 changed files with 433 additions and 1 deletions
+2
View File
@@ -10,6 +10,8 @@ data class Item(val name: String, val rating: Int) : Comparable<Item> {
}
}
val STRING_CASE_INSENSITIVE_ORDER: Comparator<String> = compareBy { it: String -> it.toUpperCase() }.thenBy { it.toLowerCase() }.thenBy { it }
class OrderingTest {
val v1 = Item("wine", 9)
val v2 = Item("beer", 10)