开发中常用Spring的工具类BeanUtils.copyProperties,但BeanUtils.copyProperties属于浅复制,不能复制集合和数组,这里针对集合的复制给出解决方案
List oldList = Arrays.asList("1","2","3");
System.out.println(oldList); //输出[1, 2, 3]
List newList = (List) oldList.stream().collect(Collectors.toList());
System.out.println(newList); //输出[1, 2, 3]



