I would like to get the same as Stream.of, but lazy. I.e. I want to do the same as
Stream<MyClass> s = Stream.of(
expression1(),
expression2(),
expression3(),
...
)
I can do
List<Supplier<MyClass>> s = Arrays.asList(
()->expression1(),
()->expression2(),
()->expression3(),
...
)
but can it be done with streams? Note that it would be duplication if suppliers are put into stream elements...