转自:http://blog.csdn.net/u013821825/article/details/66969683
private static ArrayList<FmGoodsModel> removeDuplicateUser(List<FmGoodsModel> users) {
Set<FmGoodsModel> set = new TreeSet<FmGoodsModel>(new Comparator<FmGoodsModel>() {public int compare(FmGoodsModel o1, FmGoodsModel o2) {
return o1.getGoodsName().compareTo(o2.getGoodsName());
}
});
set.addAll(users);
return new ArrayList<FmGoodsModel>(set);
}