Here you can find the source of putIfAbsent(final Map
public static <K, V> void putIfAbsent(final Map<K, V> from, final Map<K, V> to)
//package com.java2s; //License from project: Apache License import java.util.Map; public class Main { public static <K, V> void putIfAbsent(final Map<K, V> from, final Map<K, V> to) { for (Map.Entry<K, V> entry : from.entrySet()) { to.putIfAbsent(entry.getKey(), entry.getValue()); }/*from w ww.j ava2 s. c o m*/ } }