Here you can find the source of copyMap(Map
public static <T, K extends Object> void copyMap(Map<K, T> sourceMap, Map<K, T> targetMap)
//package com.java2s; //License from project: Apache License import java.util.Map; public class Main { public static <T, K extends Object> void copyMap(Map<K, T> sourceMap, Map<K, T> targetMap) { targetMap.putAll(sourceMap);/*from w w w . ja v a2 s. com*/ } }