0

Convert a Stream to List in Java 8

So, you’ve been planning to learn the new stuffs made available in Java 8. One of them is the Stream interface. Given a collection, e.g., List, a Stream can be extract using

If you wish not to create an initial list, you may use Stream.of(T... values).

For example,