java list of a class has a string that is equal to

Java
public boolean containsName(final List<MyObject> list, final String name){
    return list.stream().map(MyObject::getName).filter(name::equals).findFirst().isPresent();
}
Source

Also in Java: