Java tutorial
//package com.java2s; import java.util.Collection; import java.util.HashSet; import java.util.Set; public class Main { @SuppressWarnings({ "rawtypes", "unchecked" }) public static Collection removeDuplicates(Collection collection) { if (collection == null) return collection; Set duplicatesRemoved = new HashSet(collection); return duplicatesRemoved; } }