Java tutorial
//package com.java2s; import java.util.Arrays; import java.util.LinkedHashSet; import java.util.Set; public class Main { /** * create set from array * * @param <T> * @param values * @return array values in list */ public static <T> Set<T> toSet(T... values) { Set<T> list = new LinkedHashSet<T>(); list.addAll(Arrays.asList(values)); return list; } }