Here you can find the source of removeNullValues(Map
public static void removeNullValues(Map<String, ?> map)
//package com.java2s; //License from project: Open Source License import java.util.*; public class Main { /**//from ww w. ja va2s . c o m * Removes null values from the given map */ public static void removeNullValues(Map<String, ?> map) { if (map == null) return; map.values().removeAll(Collections.singleton(null)); } }