After sorting a collection, we often want to select only a subset of the collection, such as the first couple of elements. This is often done when only a small amount of objects are needed, or to simply select the first one.
This recipe will show you how you can select elements from the top or bottom of a list, or from somewhere in-between, using an index. Especially when examining output, you often only need the first couple of elements to see what they look like, and not the entire collection.