Here you can find the source of copyOnWritePut(K k, V v, Map
private static <K, V> Map<K, V> copyOnWritePut(K k, V v, Map<K, V> source)
//package com.java2s; //License from project: Apache License import java.util.IdentityHashMap; import java.util.Map; public class Main { private static <K, V> Map<K, V> copyOnWritePut(K k, V v, Map<K, V> source) { Map<K, V> map = new IdentityHashMap<K, V>(source); map.put(k, v);// ww w.j av a 2 s. com return map; } }