Here you can find the source of putAbsent(Map
public static <K, V> void putAbsent(Map<K, V> dest, Map<K, V> src)
//package com.java2s; //License from project: Open Source License import java.util.Map; public class Main { public static <K, V> void putAbsent(Map<K, V> dest, Map<K, V> src) { for (Map.Entry<K, V> entry : src.entrySet()) { if (!dest.containsKey(entry.getKey())) { dest.put(entry.getKey(), entry.getValue()); }/* w ww. jav a2s . c o m*/ } } }