Java Stream Limit Items

int maxNumberOfElements = 10;

list.stream()
    .limit(maxNumberOfElements); 
Syenite Phoenix