Static methods on Stream and friends
Kasper Nielsen
kasperni at gmail.com
Sun Apr 21 23:32:06 PDT 2013
> Stream.of() // for empty
> Stream.of(T) // for singleton
> Stream.of(T, T, T...) // for two or more
>
I've stopped using the latter form in my code. Because sometimes you
actually want to use an array for creating stuff and not just the vararg
signature. Having do something like Stream.of(a[0], a[1], Arrays.copyOf(a,
2)) is annoying and a waste of resources for larger arrays.
More information about the lambda-libs-spec-observers
mailing list