/**
* 去重
*
* @param orderList
* @return
* @author jqlin
*/
private static List<ansVo> removeDuplicateOrder(List<ansVo> orderList) {
Set<ansVo> set = new TreeSet<ansVo>(new Comparator<ansVo>() {
@Override
public int compare(ansVo a, ansVo b) {
// 字符串则按照asicc码升序排列
return a.getId().compareTo(b.getId());
}
});
set.addAll(orderList);
return new ArrayList<ansVo>(set);
}
转载于:https://www.cnblogs.com/zhangzhiqin/p/10387584.html