The Java Stream API: Creating Custom, Lazy, Infinite Streams
You can find the sample code from this post on GitHub.
There are a few built in ways to create your own custom streams. While many collections offer a direct .stream()
method,
you can also use Stream.of(..)
to just make one in place: