limit method of stream java 8 code example
Example: java stream limit items
int maxNumberOfElements = 10;
list.stream()
.limit(maxNumberOfElements);
int maxNumberOfElements = 10;
list.stream()
.limit(maxNumberOfElements);