Use this tag for questions related to the use of the Stream API.
Is there a concise way to iterate over a stream whilst having access to the index in the stream? String[] …
java java-8 java-streamI am playing around with lazy functional operations in Java SE 8, and I want to map an index i to …
java lambda functional-programming java-8 java-streamI am trying to use Java 8 Streams to find elements in a LinkedList. I want to guarantee, however, that there …
java lambda java-8 java-streamI'm trying to come up with a more succinct expression for the "keyMapper" function parameter in the following Collectors.toMap() …
java collections lambda java-8 java-streamJavadoc of Collector shows how to collect elements of a stream into a new List. Is there an one-liner that …
java java-8 java-stream collectorsI'm interested in sorting a list from a stream. This is the code I'm using: list.stream() .sorted((o1, o2)…
java list sorting java-streamGeneral question: What's the proper way to reverse a stream? Assuming that we don't know what type of elements that …
java list sorting java-8 java-streamIs it possible to specify a custom thread pool for Java 8 parallel stream? I can not find it anywhere. Imagine …
java concurrency parallel-processing java-8 java-streamSometimes you want to filter a Stream with more than one condition: myList.stream().filter(x -> x.size() &…
java lambda filter java-8 java-streamI have just discovered the new Java 8 stream capabilities. Coming from Python, I was wondering if there was now a …
java arrays java-8 java-stream