Here you can find the source of copy(Map to, Map from, Object keys[])
public static final Map copy(Map to, Map from, Object keys[])
//package com.java2s; //License from project: Apache License import java.util.HashMap; import java.util.Map; public class Main { public static final Map copy(Map to, Map from, Object keys[]) { if (from == null || keys == null) return to; if (to == null) to = new HashMap(); for (int i = 0; i < keys.length; i++) to.put(keys[i], from.get(keys[i])); return to; // for(int i=0;) }/*from w w w . jav a 2 s . c o m*/ }