Use this tag for questions related to the use of the Stream API.
I am playing with Java 8's streams and cannot understand the performance results I am getting. I have 2 core CPU (…
java performance parallel-processing java-8 java-streamFileWriter writer = new FileWriter(output_file); int i = 0; try (Stream<String> lines = Files.lines(Paths.get(input_file))) { …
java foreach java-stream line-numbersLets say we have this boring piece of code that we all had to use: ArrayList<Long> ids = …
java java-8 java-stream collectI am wondering, if there is already an implemented feature in streams (or Collectors) which has sorted Lists as values. …
java sorting java-stream groupingbyI am wondering why the Iterable interface does not provide the stream() and parallelStream() methods. Consider the following class: public …
java java-8 java-stream iterableIt's easy to convert List<V> into Map<K, List<V>>. For example: public …
java java-stream collectorsI have group of students. First I want to group them by the marks. Then I want to further group …
java java-8 java-stream method-reference collectI just came across a question when using a List and its stream() method. While I know how to use …
java java-8 java-streamIn C# I would use Enumerable.Empty(), but how do I create an empty Stream in Java?
java java-stream enumerableI have a list of objects A. Each object A in this list contains list of object B and the …
java list java-8 java-stream nested-loops