What you are doing may be the simplest way, provided your stream stays sequential—otherwise you will have to put a call to sequential() before forEach.

The reason the call to sequential() is necessary is that the code as it stands (forEach(targetLongList::add)) would be racy if the stream was parallel. Even then, it will not achieve the effect intended, as forEach is explicitly nondeterministic—even in a sequential stream the order of element processing is not guaranteed. You would have to use forEachOrdered to ensure correct ordering. The intention of the Stream API designers is that you will use collector in this situation, as below:

targetLongList = sourceLongList.stream()
    .filter(l -> l > 100)
    .collect(Collectors.toList());
Answer from Maurice Naftalin on Stack Overflow
🌐
Baeldung
baeldung.com › home › java › java streams › collecting stream elements into a list in java
Collecting Stream Elements into a List in Java | Baeldung
December 3, 2025 - However, there have been change requests for a method to get a List directly from a Stream instance. With the Java 16 release, we can now invoke toList(), a new method directly on the Stream, to get the List.
🌐
Stackify
stackify.com › streams-guide-java-8
A Guide to Java Streams: In-Depth Tutorial With Examples
September 4, 2024 - The strategy for this operation is provided via the Collector interface implementation. In the example above, we used the toList collector to collect all Stream elements into a List instance.
🌐
HowToDoInJava
howtodoinjava.com › home › java 8 › java collect stream to list (with examples)
Java Collect Stream to List (with Examples)
April 29, 2024 - Stream<String> tokenStream = Stream.of("A", "B", "C", "D"); List<String> tokenList = tokenStream.toList(); This method has been added in Java 10.
🌐
GeeksforGeeks
geeksforgeeks.org › java › program-to-convert-list-to-stream-in-java
Program to Convert List to Stream in Java - GeeksforGeeks
July 11, 2025 - In this program, the interface is overridden to match the strings that start with "G". Convert Stream into List using List.stream() method. Filter the obtained stream using the defined predicate condition · The required Stream has been obtained.
🌐
Blogger
javarevisited.blogspot.com › 2015 › 03 › 5-ways-to-convert-java-8-stream-to-list.html
5 ways to Convert Java 8 Stream to List - Example, Tutorial
October 6, 2021 - ... This is actually a generalization ... ArrayList, LinkedList, or any other List. In this example, we are collecting Stream elements into ArrayList....
🌐
Mkyong
mkyong.com › home › java8 › java 8 – convert a stream to list
Java 8 - Convert a Stream to List - Mkyong.com
March 18, 2019 - package com.mkyong.java8; import ...tem.out::println); } } output · java python node · Yet another example, filter a number 3 and convert it to a List....
🌐
Java67
java67.com › 2020 › 04 › how-to-get-list-or-set-from-stream-in-java8.html
How to Convert Stream to List, Set, and Collection in Java 8? Example Tutorial | Java67
In the past, I have shared 10 examples ... I'll show you a simple example of using Collectors and Stream.collect() method to convert Stream to List and Set in Java 8....
Find elsewhere
🌐
Stack Abuse
stackabuse.com › java-8-streams-convert-a-stream-to-list
Guide to Java 8 Collectors: Definitive Guide to toList()
November 19, 2024 - Though, you're not limited to just collecting a stream into a list - this is where the collectingAndThen() method comes into play. Earlier on we consulted the official documentation and, it stated that collectors have the capacity of: …optionally transforming the accumulated result into a final representation after all input elements have been processed. The accumulated result in CollectorsBloodBank, for example, is represented by Collectors.toList().
🌐
Medium
medium.com › @AlexanderObregon › javas-collectors-tolist-method-explained-0e90e5d90dcb
Java’s Collectors.toList() Method Explained | Medium
August 23, 2024 - Often, filtering and mapping are used together in a stream pipeline to achieve more complex data transformations. For example, let’s say you have a list of product prices in various currencies, and you want to filter out prices below a certain threshold and convert the remaining prices to a different currency: import java.util.List; import java.util.stream.Collectors; import java.util.stream.DoubleStream; public class PriceConversionExample { public static void main(String[] args) { double conversionRate = 0.85; // Conversion rate to another currency List<Double> convertedPrices = DoubleStream.of(100.0, 50.0, 250.0, 75.0, 300.0) .filter(price -> price > 100.0) .map(price -> price * conversionRate) .boxed() .collect(Collectors.toList()); System.out.println(convertedPrices); // Output: [212.5, 255.0] } }
🌐
JRebel
jrebel.com › blog › java-streams-in-java-8
Using Java Streams in Java 8 and Beyond | JRebel by Perforce
September 24, 2024 - In the example below, the Java stream is used as a fancy iterator: List numbers = Arrays.asList(1, 2, 3, 4); List result = numbers.stream() .filter(e -> (e % 2) == 0) .map(e -> e * 2) .collect(toList());
🌐
Java67
java67.com › 2016 › 03 › how-to-get-arraylist-from-stream-in-java8-example.html
How to Convert Stream to ArrayList in Java 8 - Collectors.toCollection() Example | Java67
All you need to do is first get the stream from List by calling stream() method, then call the filter() method to create a new Stream of filtered values and finally call the Collectors.toCollection(ArrayList::new) to collect those elements into ...
🌐
Medium
neesri.medium.com › how-to-convert-a-stream-to-list-set-map-and-different-types-of-collections-1902c849e34a
How to Convert a Stream to List, Set, Map and different types of collections. | by A cup of JAVA coffee with NeeSri | Medium
July 25, 2025 - So, if the stream was generated from a list of elements like [1, 2, 3, 4], the resulting list will also maintain the order [1, 2, 3, 4]. This is one of the key properties of a List in Java — it preserves the order of insertion.
🌐
Winterbe
winterbe.com › posts › 2014 › 07 › 31 › java8-stream-tutorial-examples
Java 8 Stream Tutorial - winterbe
A stream represents a sequence of elements and supports different kind of operations to perform computations upon those elements: List<String> myList = Arrays.asList("a1", "a2", "b1", "c2", "c1"); myList .stream() .filter(s -> s.startsWith("c")) .map(String::toUpperCase) .sorted() ...
🌐
GeeksforGeeks
geeksforgeeks.org › java › stream-in-java
Stream In Java - GeeksforGeeks
Below is the syntax given for declaring a Java Stream. ... A Stream is not a data structure; it just takes input from Collections, Arrays or I/O channels. Streams do not modify the original data; they only produce results using their methods. Intermediate operations (like filter, map, etc.) are lazy and return another Stream, so you can chain them together.
Published   3 weeks ago
🌐
How to do in Java
howtodoinjava.com › home › java streams › java stream api: real-world examples for beginners
Java Stream API: Real-world Examples for Beginners
September 19, 2023 - In the given example, first, we create a stream on integers 1 to 10. Then we process the stream elements to find all even numbers. At last, we are collecting all even numbers into a List.
🌐
Oracle
oracle.com › java › technical details
Processing Data with Java SE 8 Streams, Part 1
However, notice the use of lambda expressions (for example, t-> t.getCategory() == Transaction.GROCERY) and method references (for example, Transaction::getId), which you should be familiar with by now. (To brush up on lambda expressions, refer to previous Java Magazine articles and other resources listed at the end of this article.) For now, you can see a stream as an abstraction for expressing efficient, SQL-like operations on a collection of data.
🌐
Baeldung
baeldung.com › home › java › java streams › the java stream api tutorial
The Java Stream API Tutorial | Baeldung
October 5, 2023 - So to make the previous code work properly, some changes should be made: List<String> elements = Stream.of("a", "b", "c").filter(element -> element.contains("b")) .collect(Collectors.toList()); Optional<String> anyElement = elements.stream(...
🌐
Oracle
docs.oracle.com › javase › 8 › docs › api › java › util › stream › package-summary.html
java.util.stream (Java Platform SE 8 )
3 weeks ago - The three aspects of collect -- supplier, accumulator, and combiner -- are tightly coupled. We can use the abstraction of a Collector to capture all three aspects. The above example for collecting strings into a List can be rewritten using a standard Collector as: List<String> strings = stream.ma...