yegor256 / cactoos

Object-Oriented Java primitives, as an alternative to Google Guava and Apache Commons
https://www.cactoos.org
MIT License
737 stars 163 forks source link

CollectionEnvelope<T>, ListEnvelope<T>, etc. should support the Stream<T> in ctor #1584

Open dgroup opened 3 years ago

dgroup commented 3 years ago

What do you think about adding a separate constructor to CollectionEnvelope<T>, ListEnvelope<T> which allows to pass Stream instead of collection?

It allows to have lazy initialization without scalar+sticky.

victornoel commented 3 years ago

@dgroup could you show an example of what you mean by "It allows to have lazy initialization without scalar+sticky."?

There are two different points we have to clarify: