contains in list of objects in java code example
Example: java list contains object with property
boolean found = list.stream()
.anyMatch(p -> p.name.equals(personName));
boolean found = list.stream()
.anyMatch(p -> p.name.equals(personName));