前提: 类 Task 有个name属性 集合List<Task> ts 初始化 boolean b = ts.stream().anyMatch(task -> task.getName().equals("作业9"));