private static ConcurrentMap<String, Set<Object>> data = new ConcurrentHashMap<String, Set<Object>>();
public static void add(String type, Object object) {
Set<Object> set = data.get(type);
if(set == null) {
set = Collections.newSetFromMap(new MapMaker().weakKeys().<Object, Boolean>makeMap());
Set<Object> existing = data.putIfAbsent(type, set);
if(existing != null) {
set = existing;
}
}