Here you can find the source of copyMap(Map from, Map to)
public static void copyMap(Map from, Map to)
//package com.java2s; //License from project: Apache License import java.util.Map; public class Main { public static void copyMap(Map from, Map to) { if (from == null || to == null) return; for (Object key : from.keySet()) { to.put(key, from.get(key));/* w w w. jav a2 s . c o m*/ } } }