public static <K, V> V putToConcurrentMap(ConcurrentMap<K, V> map, K key, V value) {
        V old = map.putIfAbsent(key, value);
        return old != null ? old : value;
    }
@Test
    public void testPutToConcurrentMap() throws Exception {
        final ConcurrentMap<String, AtomicInteger> hashMap = new ConcurrentHashMap<String, AtomicInteger>();
        final CountDownLatch latch = new CountDownLatch(3);
        for (int i = 0; i < 3; i++) {
            Thread thread = new Thread(new Runnable() {
                @Override
                public void run() {
                    for (int j = 0; j < 10000; j++) {
                        AtomicInteger inter = CommonUtils.putToConcurrentMap(hashMap, "key", new AtomicInteger(0));
                        inter.incrementAndGet();
                    }
                    latch.countDown();
                }
            });
            thread.start();
        }
        latch.await();
        Assert.assertEquals(hashMap.get("key").get(), 30000);
    }