Java tutorial
//package com.java2s; //License from project: Open Source License import java.util.LinkedHashSet; import java.util.Set; public class Main { /** * it returns an ordered Set implementation with the specified initial capacity * * @return */ public static <T> Set<T> newOrderedSet(int initialCapacity) { return new LinkedHashSet<>(initialCapacity); } /** * it returns an ordered Set implementation * * @return */ public static <T> Set<T> newOrderedSet() { return new LinkedHashSet<>(); } }