Probably the easiest way is to convert iterator to Sequence first and then to List:
listOf(1,2,3).iterator().asSequence().toList()
result:
[1, 2, 3]
Probably the easiest way is to convert iterator to Sequence first and then to List:
listOf(1,2,3).iterator().asSequence().toList()
result:
[1, 2, 3]