Should examples cover an broad idea exhaustively with many snippets of code, or cover a specific idea with one or a few?
For example, in the broad Java topic Streams, an example "Creating a stream" shows many snippets of creating streams from many different kinds of input. And it is likely to grow over time, because there are still more ways to create streams.
The breadth of the title would make it a good chapter in a book. But finding a snippet for one particular way of creating a stream may require reading through the entire example.
It really looks like multiple examples rolled into one. It has examples for creating a stream from a collection, creating a stream from an array, creating a stream from an iterator, etc.
Question 1: Would this be better presented as individual examples, named appropriately?
Question 2: Should the whole concept of "Creating a stream" be a separate topic?