需求分析 一个list集合内有name,sex字段,需要判断list中是否有name有叫张三的人,如果有返回true 代码 list.stream.filter(m->m.getName().equals("张三")).findAny().isPresent(); 运行结果