Here you can find the source of removeDuplicates(List
public static <T> List<T> removeDuplicates(List<T> collection)
//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; } }