Here you can find the source of cloneMap(Map
public static <K, V> Map<K, V> cloneMap(Map<K, V> map)
//package com.java2s; //License from project: Open Source License import java.util.HashMap; import java.util.Map; public class Main { /** Creates a duplicate of the specified map */ public static <K, V> Map<K, V> cloneMap(Map<K, V> map) { Map<K, V> tempUpdates = new HashMap<K, V>(); tempUpdates.putAll(map);/*from w w w . j av a 2 s.c o m*/ return tempUpdates; } }