Unfortunately, we don't support JDK 8 yet. We are planning do it after JDK 8 is released.
In this particular case, our SAM check thinks that Comparator (used in sort()) and UnaryOperator (used in iterate()) have more than one abstract method, so they are not SAM.
Good news that Kotlin standard library covers your cases and the code is much cleaner, look:
fun main(args: Array<String>) {
val arrayList = arrayListOf(1, 2, 3)
arrayList.sortBy { it }
// or:
arrayList.sort()
“hello”.forEach { t -> println(t) }
// or this:
for (t in “hello”) {
println(t)
}
}