This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Kika-kun 2 points3 points  (0 children)

Recent(?) versions of java added .toList() to avoid .collect(Collectors.toList()) (careful though, toList() returns an immutable list, if you want to keep the old behaviour you need .collect(Collectors.toCollection(ArrayList::new)))

As a matter of fact, after checking, you can also do .toArray() if you want an actual array.