Java examples for java.util:Map Entry
Add Not Null Key to Map
//package com.java2s; import java.util.Map; public class Main { public static <K, V> boolean putMapNotNullKey(Map<K, V> map, K key, V value) {//from w ww .j a va 2 s .c o m if (map == null || key == null) { return false; } map.put(key, value); return true; } }