Here you can find the source of clone(Map
public static <K, V> Map<K, V> clone(Map<K, V> map1)
//package com.java2s; //License from project: Open Source License import java.util.*; public class Main { public static <K, V> Map<K, V> clone(Map<K, V> map1) { Map<K, V> map2 = new HashMap<K, V>(map1.size()); for (Map.Entry<K, V> e : map1.entrySet()) { map2.put(e.getKey(), e.getValue()); }/*from w ww . ja v a2 s. c om*/ return map2; } }