The Stream of the desired size is returned using the limit() method. As an illustration, if you mentioned limit(5), there would be 5 output elements.