Skip to content

Commit f204b61

Browse files
tomekl007pivovarit
authored andcommitted
Bael 779 kotlin generics (eugenp#1671)
* Kotlin Generics code * wrote rest of the tests * sorting impl * proper val name * fix typo * better assert
1 parent 6c181db commit f204b61

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

‎kotlin/src/test/kotlin/com/baeldung/kotlin/GenericsTest.kt‎

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115,12 +115,7 @@ class GenericsTest {
115115
val sorted = sort(listOfInts)
116116

117117
//then
118-
assertEquals(sorted[0], 1)
119-
assertEquals(sorted[1], 2)
120-
assertEquals(sorted[2], 3)
121-
assertEquals(sorted[3], 4)
122-
assertEquals(sorted[4], 5)
123-
118+
assertEquals(sorted, listOf(1,2,3,4,5))
124119
}
125120

126121
fun <T: Comparable<T>> sort(list: List<T>): List<T>{

0 commit comments

Comments
 (0)