1 package org.opendaylight.yangtools.triemap;
3 import java.util.concurrent.ConcurrentMap;
7 public class TestConcurrentMapPutIfAbsent {
8 private static final int COUNT = 50*1000;
11 public void testConcurrentMapPutIfAbsent () {
12 final ConcurrentMap<Object, Object> map = new TrieMap<Object, Object> ();
14 for (int i = 0; i < COUNT; i++) {
15 TestHelper.assertTrue (null == map.putIfAbsent (i, i));
16 TestHelper.assertTrue (Integer.valueOf (i).equals (map.putIfAbsent (i, i)));