Java List Remove Duplicate removeDuplicates(List collection)

Here you can find the source of removeDuplicates(List collection)

Description

remove Duplicates

License

Open Source License

Declaration

public static <T> List<T> removeDuplicates(List<T> collection) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.*;

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

Related

  1. removeDuplicates(int[] list)
  2. removeDuplicates(List list)
  3. removeDuplicates(List listofthings)
  4. removeDuplicates(List commonVars)
  5. removeDuplicates(List l)
  6. removeDuplicates(List list)
  7. removeDuplicates(List list, Comparator comparator)
  8. removeDuplicates(List lst)
  9. removeDuplicateWithOrder(List list)