1 2 private List<YourBean> removeDuplicate(List<YourBean> list) { 3 Set<YourBean> set = new HashSet<YourBean>(); 4 List<YourBean> newList = new ArrayList<YourBean>(); 5 for (Iterator<YourBean> iter = list.iterator(); iter.hasNext();) { 6 YourBean element = (YourBean) iter.next(); 7 if (set.add(element)) 8 newList.add(element); 9 } 10 return newList; 11 }