Java tutorial
//package com.java2s; import java.util.Set; public class Main { /** * Adds several values to a set. * * @param <T> * the set's element type. * @param set * the set. * @param values * the values to be added. * @return the given set. */ @SafeVarargs public static <T> Set<T> addToSet(final Set<T> set, final T... values) { for (final T t : values) { set.add(t); } return set; } }