Top "Java-stream" questions

Use this tag for questions related to the use of the Stream API.

Stream of boolean values, is any true?

I want to parallelize the following code snipped using a parallelStream: boolean anyTrue() { for (Element e : setOfE) { if (eval(e)) { …

java lambda parallel-processing java-8 java-stream
Cleanest way to create a guava MultiMap from a java8 stream

I have a List<Foo> and want a Multimap<String, Foo> where we've grouped the Foo's …

guava java-8 java-stream
forEach vs forEachOrdered in Java 8 Stream

I understand that these methods differ the order of execution but in all my test I cannot achieve different order …

java foreach java-8 java-stream
Java 8 Stream: difference between limit() and skip()

Talking about Streams, when I execute this piece of code public class Main { public static void main(String[] args) { Stream.…

java java-8 limit java-stream skip
Transform and filter a Java Map with streams

I have a Java Map that I'd like to transform and filter. As a trivial example, suppose I want to …

java java-8 java-stream collectors
java.util.stream with ResultSet

I have few tables with big amount of data (about 100 million records). So I can't store this data in memory …

java jdbc lambda java-stream jooq
How to check if exists any duplicate in Java 8 Streams?

In java 8, what's the best way to check if a List contains any duplicate? My idea was something like: list.…

java java-8 duplicates java-stream
In Java streams is peek really only for debugging?

I'm reading up about Java streams and discovering new things as I go along. One of the new things I …

java java-8 java-stream peek
Use method reference with parameter

I just started learning Java streams and faced a problem. Please take a look at a the following example. This …

java lambda java-stream method-reference functional-interface
Most efficient way to get the last element of a stream

Stream doesn't have a last() method: Stream<T> stream; T last = stream.last(); // No such method What's the …

java java-8 java-stream