// Dummy value to associate with an Object in the backing Map private static final Object PRESENT = new Object();
A thread-safe implementation is available with `ConcurrentHashMap.newKeySet()`, which uses a similar approach:
public static <K> KeySetView<K,Boolean> newKeySet() { return new KeySetView<K,Boolean> (new ConcurrentHashMap<K,Boolean>(), Boolean.TRUE); }