I understand that Java 8 Stream provides .collect
method to convert a Stream to any collection / data Structure of our choice, and it is very generic in nature. Understand that Stream might be originated from non-collection object / resouce. But from usage perspective, it is pretty natural to convert Stream to List / Set.
Stream already provides toArray()
method to convert to array, so why not toList()
and toSet()
?