Here you can find the source of removeEmptyArray(Map
public static <K, V> Map<K, V> removeEmptyArray(Map<K, V> map)
//package com.java2s; //License from project: Open Source License import java.util.Iterator; import java.util.Map; public class Main { public static <K, V> Map<K, V> removeEmptyArray(Map<K, V> map) { if (map != null && !map.isEmpty()) { Iterator<Map.Entry<K, V>> i = map.entrySet().iterator(); while (i.hasNext()) { Map.Entry<K, V> entry = i.next(); V value = entry.getValue(); if ((value instanceof Object[]) && ((Object[]) value).length == 0) i.remove();//from w w w. ja v a 2s . c o m } } return map; } }