public static <K, V> V getOrPutIfAbsent(ConcurrentMap<K, V> map, K key, ConstructorFunction<K, V> func) {
        V value = map.get(key);
        if (value == null) {
            value = func.createNew(key);
            V current = map.putIfAbsent(key, value);
            value = current == null ? value : current;
        }
        return value;
    }
@Test
    public void testGetOrPutIfAbsent() {
        int result = ConcurrencyUtil.getOrPutIfAbsent(map, 5, constructorFunction);
        assertEquals(1005, result);

        result = ConcurrencyUtil.getOrPutIfAbsent(map, 5, constructorFunction);
        assertEquals(1005, result);

        assertEquals(1, constructorFunction.getConstructions());
    }