SyntaxFix
Write A Post
Hire A Developer
Questions
This is how to do it using Java 8+ :
boolean isJohnAlive = list.stream().anyMatch(o -> o.getName().equals("John"));