You are asking the wrong question. Are you asking about sequential vs. parallel , whereas you want to process the elements in order, so you need to ask about the order. If you have an ordered stream and perform operations that guarantee maintenance of order, it does not matter if the stream is processed in parallel or sequentially; implementation will maintain order.
The ordered property is different from parallel vs serial. For example. if you call stream() in a HashSet , the stream will be unordered, and calling stream() in List returns an ordered stream. Note that you can call unordered() to release the contract for the order and potentially increase performance. Once the stream has no order, there is no way to restore the order. (The only way to turn an unordered stream into an ordered one is to call sorted , but the result is not necessarily the original order).
See also the Order section of the java.util.stream package for documentation .
To ensure that order is maintained throughout the flow operation, you need to study the flow source documentation, all intermediate operations, and the terminal operation to see if they support the order or not (or does the source have order first).
It can be very subtle, for example. Stream.iterate(T,UnaryOperator) creates an ordered stream, and Stream.generate(Supplier) creates an unordered stream. Note that you also made a common mistake in your question, since forEach does not support ordering. You must use forEachOrdered if you want to process stream elements in a guaranteed manner.
So, if your List in your question is really java.util.List , its stream() method will return an ordered stream, and filter will not change the order. Therefore, if you call list.stream().filter() .forEachOrdered() , all elements will be processed sequentially in order, whereas for list.parallelStream().filter().forEachOrdered() elements can be processed in parallel (for example, filter), but the terminal action will still be called in order (which, obviously, will reduce the advantage of parallel execution).
If you, for example, use an operation like
List<…> result=inputList.parallelStream().map(…).filter(…).collect(Collectors.toList());
the whole operation may benefit from parallel execution, but the resulting list will always be in the correct order, regardless of whether you use parallel or sequential stream.