toList
Returns a List containing all elements produced by this stream.
import java.util.stream.*
import kotlin.streams.*
fun main(args: Array<String>) {
//sampleStart
val doubleStream: DoubleStream = DoubleStream.of(1e2, 1e3, 1e4)
val doubleList: List<Double> = doubleStream.toList()
println(doubleList) // [100.0, 1000.0, 10000.0]
//sampleEnd
}