/** * @author hisenyuan * @time 2018/4/19 14:06 * @description list对象根据属性去重 lambda + stream */ public class ListDuplicateTest {
public static void main(String[] args) { List<Person> list = new ArrayList<>(); for (int i = 0; i < 100; i++) { Person person = new Person(); person.setAge(10); person.setName("hsien"); person.setWeight(i); list.add(person); } Person bean = new Person(); bean.setName("hisenyuan"); bean.setAge(33); bean.setWeight(65); list.add(bean);