Files
kotlin-fork/nj2k/testData/newJ2k/javaStreamsApi/formatting.kt
T
Ilya Kirillov 043a669812 New J2K: do not print qualified names if corresponding qualifier can unambiguously resolved
This speeds up shortening qualified references phase
2019-09-29 11:39:37 +03:00

13 lines
629 B
Kotlin
Vendored

import java.util.stream.Collectors
internal class Test {
fun main(lst: List<Int>) {
val newLst = /*before list*/lst /*after list*/.stream /*before stream*/() /* after stream*/
.filter { x: Int -> x > 10 }
.map { x: Int -> x + 2 } /*some comment*/.distinct /*another comment*/() /* one more comment */.sorted() /*another one comment*/
.sorted(Comparator.naturalOrder())
.peek { x: Int? -> println(x) }.limit(1)
.skip(42) /*skipped*/ /*collecting one*/
.collect /*collecting two */(Collectors.toList()) /* cool */
}
}