limit abstract method

GenericStream<T> limit(
  1. int maxSize
)

Returns a stream consisting of the elements of this stream, truncated to be no longer than maxSize in length.

Example

final first5 = GenericStream.range(1, 100)
    .limit(5);

Implementation

GenericStream<T> limit(int maxSize);