Java tutorial
//package com.java2s; /* * Copyright 2011-2016 ZXC.com All right reserved. This software is the confidential and proprietary information of * ZXC.com ("Confidential Information"). You shall not disclose such Confidential Information and shall use it only in * accordance with the terms of the license agreement you entered into with ZXC.com. */ import java.util.ArrayList; import java.util.LinkedHashSet; import java.util.List; public class Main { @SuppressWarnings({ "unchecked", "rawtypes" }) public static <T> List<T> distinceList(List<T> l) { return new ArrayList(new LinkedHashSet(l)); } }