Java tutorial
//package com.java2s; //License from project: Open Source License import java.util.Collections; import java.util.Set; import java.util.concurrent.ConcurrentHashMap; public class Main { public static <T> Set<T> newConcurentHashSet() { return Collections.newSetFromMap(new ConcurrentHashMap<T, Boolean>()); } public static <T> Set<T> newConcurentHashSet(int initialCapacity) { return Collections.newSetFromMap(new ConcurrentHashMap<T, Boolean>(initialCapacity)); } }