ConcurrentHashSet

You could use a map with a useless value as well and use containsKey, but using a Set makes the semantics clearer.

Collections.newSetFromMap(new ConcurrentHashMap<YourClass, Boolean>());

Leave a Reply