Here you can find the source of fillEmptyEntries(Iterable extends Long> keys, Map
public static <T> void fillEmptyEntries(Iterable<? extends Long> keys, Map<Long, List<T>> map)
//package com.java2s; //License from project: Open Source License import java.util.Collections; import java.util.List; import java.util.Map; public class Main { /**/*from ww w .j a v a 2 s . com*/ * Adds a references to the empty list for keys to the map that are * currently not yet contained in this map. */ public static <T> void fillEmptyEntries(Iterable<? extends Long> keys, Map<Long, List<T>> map) { for (Long processId : keys) { if (!map.containsKey(processId)) { List<T> empty = Collections.emptyList(); map.put(processId, empty); } } } }