Java tutorial
//package com.java2s; import java.util.HashSet; import java.util.Set; public class Main { public static Set toSet(String... values) { Set<Object> set = new HashSet(); for (String value : values) { set.add(value); } return set; } }