Java examples for java.util:Set Creation
Create new LinkedHashSet from Array
//package com.java2s; import java.util.Arrays; import java.util.LinkedHashSet; public class Main { public static <E> LinkedHashSet<E> newLinkedHashSet(E... elements) { if (elements == null) { throw new NullPointerException(); }/*w w w .j ava 2 s . c o m*/ return new LinkedHashSet<E>(Arrays.asList(elements)); } }