Is it possible to cast a Stream in Java 8?
Is it possible to cast a stream in Java 8? Say I have a list of objects, I can do something like this … Read more
Is it possible to cast a stream in Java 8? Say I have a list of objects, I can do something like this … Read more
I’m having trouble fully understanding the role that the combiner fulfills in Streams reduce method. For example, the following code doesn’t compile: int … Read more
Javadoc of Collector shows how to collect elements of a stream into a new List. Is there an one-liner that adds the results … Read more
In Java 8, there is Stream.collect which allows aggregations on collections. In Kotlin, this does not exist in the same way, other than … Read more
General question: What’s the proper way to reverse a stream? Assuming that we don’t know what type of elements that stream consists of, … Read more
I have just discovered the new Java 8 stream capabilities. Coming from Python, I was wondering if there was now a neat way … Read more
Is there a Java 8 stream operation that limits a (potentially infinite) Stream until the first element fails to match a predicate? In … Read more
I have a collection of BigDecimals (in this example, a LinkedList) that I would like to add together. Is it possible to use … Read more
I am playing around with lazy functional operations in Java SE 8, and I want to map an index i to a pair … Read more
Note: this question originates from a dead link which was a previous SO question, but here goes… See this code (note: I do … Read more