Here you can find the source of copy(Map
public static Map<String, Map<String, String>> copy(Map<String, Map<String, String>> original)
//package com.java2s; //License from project: Apache License import java.util.HashMap; import java.util.Map; public class Main { public static Map<String, Map<String, String>> copy(Map<String, Map<String, String>> original) { Map<String, Map<String, String>> copy = new HashMap<>(); if (original != null) { for (String key : original.keySet()) { copy.put(key, new HashMap<>(original.get(key))); }// www .j av a 2s . c o m } return copy; } }