This is a platform for User Generated Content. G/O Media assumes no liability for content posted by Kinja users to this platform.

So you need a ConcurrentHashSet?

...in Java 6, a method newSetFromMap() was added to the java.util.Collections class for creating new sets based on maps. The generic type parameter K of the map should be the element type inside the set and the V should be a Boolean, used to confirm the presence of the element.

Creating Sets from Maps

Advertisement

Share This Story

Get our newsletter