Files
java-core-examples/streams/output/03-intermediateops.txt
T

15 lines
599 B
Plaintext

filter even : [2, 4, 6, 8, 10]
map toUpperCase : [HELLO, WORLD, JAVA]
map (no flatten) : [3, 2, 4] <- one result per inner list
flatMap(List::stream): [1, 2, 3, 4, 5, 6, 7, 8, 9]
mapMulti (dup evens): [1, 2, 2, 3, 4, 4]
sorted() : [Alice, Bob, Carol, Dave]
sorted(reverse) : [Dave, Carol, Bob, Alice]
sorted(len, alpha) : [Bob, Dave, Alice, Carol]
distinct() : [1, 2, 3, 4, 5]
limit(4) : [1, 2, 2, 3]
skip(5) : [3, 4, 5]
takeWhile(< 5) : [1, 2, 3]
dropWhile(< 5) : [10, 2, 1]
filter(< 5) : [1, 2, 3, 2, 1] <- not the same thing