For do this you can use :
anyMatch(conditional)
The anyMatch will make the interaction until take a conditional return equals true. I will put here a good example.
Full Example:
private Map<MyObject, List<MySecondObject>> myMap;
myMap.entrySet().stream().forEach( m -> {
m.getValue().stream().forEach( value-> {
value.getComponent().stream().anyMatch(c -> {
if (c.getId().equals(myEspecialId)) {
if (c.getName() == null) {
{...}
return true;
} else {
{...}
return true;
}
}
return false;
});
});
});