Java tutorial
//package com.java2s; import java.util.HashMap; import java.util.Map; public class Main { public static <K, V> HashMap<K, V> toHashMap(Map<K, V> map) { HashMap<K, V> result = new HashMap<>(map.size()); result.putAll(map); return result; } }