Ejemplo n.º 1
0
 public Integer call() throws Exception {
   _barrier.await();
   int count = 0;
   for (TestKey item : _items) {
     if (_map.contains(item._id)) {
       System.err.printf("COLLISION DETECTED: %s exists\n", item.toString());
     }
     final TestKey exists = _map.putIfAbsent(item._id, item);
     if (exists == null) {
       count++;
     } else {
       System.err.printf(
           "COLLISION DETECTED: %s exists as %s\n", item.toString(), exists.toString());
     }
   }
   return count;
 }