Here you can find the source of copySafelyToObjectToObjectMap(java.util.Map, ?> map)
public static java.util.Map<Object, Object> copySafelyToObjectToObjectMap(java.util.Map<?, ?> map)
//package com.java2s; //License from project: Open Source License public class Main { public static java.util.Map<Object, Object> copySafelyToObjectToObjectMap(java.util.Map<?, ?> map) { java.util.Map<Object, Object> castedCopy = new java.util.LinkedHashMap<Object, Object>(); if (map == null) { return castedCopy; }/*ww w . j a v a 2s . com*/ java.util.Iterator<?> it = map.keySet().iterator(); while (it.hasNext()) { Object nextKey = it.next(); castedCopy.put(nextKey, map.get(nextKey)); } return castedCopy; } }