Here you can find the source of copy(Map
public static <T, K> void copy(Map<T, K> src, Map<T, K> dst)
//package com.java2s; //License from project: Open Source License import java.util.Map; import java.util.Map.Entry; public class Main { public static <T, K> void copy(Map<T, K> src, Map<T, K> dst) { for (Entry<T, K> e : src.entrySet()) { dst.put(e.getKey(), e.getValue()); }//from w w w . j a v a 2 s . c o m } }