Use this tag for questions related to the use of the Stream API.
I'd like to use java.util.Optional.orElseThrow() with an Exception type that asks for a constructor parameter. Something like …
java java-8 java-streamI can add streams or extra elements, like this: Stream stream = Stream.concat(stream1, Stream.concat(stream2, Stream.of(element)); …
java concat java-8 java-streamI have the following situation Map<Key, ListContainer> map; public class ListContainer{ List<AClass> lst; } I …
java list java-8 java-streamI have a data set represented by a Java 8 stream: Stream<T> stream = ...; I can see how to …
java java-8 java-streamI have an ArrayList and want sort it in descending order. I use for it java.util.stream.Stream.sorted(…
java sorting java-8 comparator java-streamIs it possible to cast a stream in Java 8? Say I have a list of objects, I can do something …
java java-8 java-streamThe Java 8 Collectors.toMap throws a NullPointerException if one of the values is 'null'. I don't understand this behaviour, maps …
java nullpointerexception java-8 java-stream collectorsI am new to Java8. I have implemented lists and filters. I have done a null check in my code. …
filter java-8 java-stream empty-listSuppose to have a class Obj class Obj{ int field; } and that you have a list of Obj instances, i.…
java filter java-8 java-streamHow can I check if a Stream is empty and throw an exception if it's not, as a non-terminal operation? …
java java-8 java-stream