Java List Remove Duplicate removeDup(List lst)

Here you can find the source of removeDup(List lst)

Description

remove Dup

License

Apache License

Declaration

public static <T> List<T> removeDup(List<T> lst) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.util.ArrayList;
import java.util.List;

public class Main {
    public static <T> List<T> removeDup(List<T> lst) {
        final List<T> l = new ArrayList<>();
        for (T t : lst) {
            if (!l.contains(t))
                l.add(t);//from   ww w .ja  v  a  2s .c  o m
        }
        return l;
    }
}

Related

  1. removeDublicates(List l)
  2. removeDuplicate(Collection entityList)
  3. removeDuplicate(List uidList)
  4. removeDuplicate(List dest, List src)
  5. removeDuplicates(int[] list)