list去重(String)

  |   0 评论   |   0 浏览
	/**
	 * list去重
	 * @param <T>
	 * @param list
	 * @return
	 */
	public static <T> List<T> removeDuplicate(List<T> list) {   
	    HashSet<T> h = new HashSet<T>(list);   
	    list.clear();   
	    list.addAll(h);   
	    return list;   
	}