List of usage examples for java.util.concurrent ConcurrentHashMap newKeySet
public static <K> KeySetView<K, Boolean> newKeySet()
From source file:ubicrypt.core.Utils.java
public static <T> Set<T> copySynchronized(final Set<T> set) { final Set<T> ret = ConcurrentHashMap.newKeySet(); ret.addAll(set);/*w ww . j a va2 s . c o m*/ return ret; }
From source file:uk.gov.gchq.koryphe.serialisation.json.SimpleClassNameCache.java
private static Set<Class> createParentClasses() { final Set<Class> newParentClasses = ConcurrentHashMap.newKeySet(); newParentClasses.addAll(DEFAULT_PARENT_CLASSES); for (final Class clazz : ReflectionUtil.getAnnotatedTypes(JsonSimpleClassName.class)) { final JsonSimpleClassName anno = (JsonSimpleClassName) clazz.getAnnotation(JsonSimpleClassName.class); if (null != anno) { if (anno.includeSubtypes()) { newParentClasses.add(clazz); }/* w w w .jav a2 s . c om*/ } } return newParentClasses; }