Here you can find the source of putAll(Map
public static <K, V> void putAll(Map<K, V> dest, Collection<K> src, V value)
//package com.java2s; //License from project: Open Source License import java.util.Collection; import java.util.Map; public class Main { public static <K, V> void putAll(Map<K, V> dest, Collection<K> src, V value) { for (K k : src) { dest.put(k, value);/* ww w . j av a2s.c o m*/ } } }