Java tutorial
//package com.java2s; import java.util.*; public class Main { public static <T> Set<T> toListSet(T... arr) { Set<T> set = new LinkedHashSet<T>(); for (T t : arr) set.add(t); return set; } }