When using external iteration over an java collectios we use keyword "continue" for move to the next value in a loop. What about in the case, when we use java stream API? Example:
List<User> users;
for(Item item : item){
users.stream()
.filter(user -> user.getName().equals("Tom"))
.findFirst()
.ifPresent(move to the next value in a outer loop(items) ???? like **continue**;);
more code here...
}
Without stream:
for(Item item : item){
for(User user : users){
if(user.getName("Tom") exist = true;
}
if (exist) continue;
more code here...
}
findFirst()returns just a single element (if present). If you want to iterate over all the elements, useforEach().Tom?