Java tutorial
//package com.java2s; import java.util.Set; public class Main { public static <T> void fillSetFromArray(Set<T> set, final T[] array) { for (T t : array) { set.add(t); } } }