toList
Returns all elements of this list as a List of type E.
Calling from Kotlin
Here's an example of calling this method from Kotlin code:
val notEmptyList: NotEmptyList<Int> = notEmptyListOf(1, 2, 3)
val actual: List<Int> = notEmptyList.toList()
val expected: List<Int> = listOf(1, 2, 3)
assertContentEquals(expected, actual)
Content copied to clipboard