泛型实现 数组复制
public static <T> List<T> listCopy(Class<T> var1, Object orig){
List<T> list = new ArrayList<T>();
for (Object object: (List<?>)orig) {
try {
T newInstance = var1.newInstance();
BeanUtils.copyProperties(newInstance, object);
list.add(newInstance);
} catch (IllegalAccessException | InvocationTargetException |InstantiationException e) {
log.error("bean复制失败",e);
}
}
return list;
}