Java tutorial
//package com.java2s; //License from project: Open Source License import java.util.LinkedHashSet; import java.util.Set; import java.util.Arrays; public class Main { /** * Get a new {@link LinkedHashSet} with the elements * @param elements T * @param <T> * @return Set */ @SuppressWarnings("unchecked") public static <T> Set<T> linkSet(final T... elements) { return new LinkedHashSet<T>(Arrays.asList(elements)); } }