contains member java code example
Example 1: java list of a class has a string that is equal to
public boolean containsName(final List<MyObject> list, final String name){
return list.stream().map(MyObject::getName).filter(name::equals).findFirst().isPresent();
}
Example 2: java list contains object with property
boolean found = list.stream()
.anyMatch(p -> p.name.equals(personName));