Java tutorial
//package com.java2s; import java.util.Collections; import java.util.HashMap; public class Main { public static <K, V> HashMap<K, V> synchronizedMap() { return (HashMap<K, V>) Collections.synchronizedMap(new HashMap<K, V>()); } }