Here you can find the source of deepCopy(Map map)
public static Map deepCopy(Map map)
//package com.java2s; //License from project: Open Source License import java.util.Collections; import java.util.HashMap; import java.util.Map; public class Main { public static Map deepCopy(Map map) { Map result = new HashMap(); for (Object o : map.keySet()) { result.put(o, map.get(o));// w w w . j av a2 s. co m } result = Collections.unmodifiableMap(result); return result; } }