Specifically, I have TabPane, and I would like to know if there is element with specific ID in it.
So, I would like to do this with lambda expression in Java:
While the accepted answer is correct, I'll add a more elegant version (in my opinion):
boolean idExists = tabPane.getTabs().stream() .map(Tab::getId) .anyMatch(idToCheck::equals);
Don't neglect using Stream#map() which allows to flatten the data structure before applying the Predicate.
Predicate