过滤<br>
过滤过程通过传入的Editor实现来返回需要的元素内容，这个Editor实现可以实现以下功能：

<pre>
1、过滤出需要的对象，如果返回null表示这个元素对象抛弃
2、修改元素对象，返回集合中为修改后的对象
</pre>

@param <K> Key类型
@param <V> Value类型
@param map Map
@param editor 编辑器接口
@return 过滤后的Map
@see MapUtil#filter(Map, Editor)
547505
public static <K, V> Map<K, V> filter(Map<K, V> map, Editor<Entry<K, V>> editor) {
		return MapUtil.filter(map, editor);
	}
272050
static String getValue(Map<String, String> map, String... keys) {
        if (CommonUtils.isEmpty(map)) {
            return null;
        }
        for (String key : keys) {
            String val = map.get(key);
            if (val != null) {
                return val;
            }
        }
        return null;
    }
1063067
public JsonWriter value(Map<String, ?> map) throws IOException {
      if (map == null) {
         nullValue();
      } else {
         boolean inObject = inObject();
         if (!inObject) beginObject();
         for (Map.Entry<String, ?> entry : map.entrySet()) {
            property(entry.getKey(), entry.getValue());
         }
         if (!inObject) endObject();
      }
      popIf(JsonTokenType.NAME);
      return this;
   }
430436
public static <K, V> Map<K, V> sortNumberMapByValueDescending(Map<K, V> map) {
        ArrayList<Map.Entry<K, V>> entries = new ArrayList<>(map.entrySet());
        Collections.sort(entries, (Map.Entry<K, V> a, Map.Entry<K, V> b) -> {
            Double va = TypeInference.toDouble(a.getValue());
            Double vb = TypeInference.toDouble(b.getValue());
            return -va.compareTo(vb);
        });
        
        Map<K, V> sortedMap = new LinkedHashMap<>();
        for (Map.Entry<K, V> entry : entries) {
          sortedMap.put(entry.getKey(), entry.getValue());
        }
        
        return sortedMap;
    }
140460
public Map<String, String> getParametersToMap(Map<String, String> map) {
        if (map == null) map = new LinkedHashMap<>();
        final Map<String, String> map0 = map;
        getParameters().forEach((k, v) -> map0.put(k, v));
        return map0;
    }
403432
public static void removeValue(Map map, Object value) {
	Iterator it = map.entrySet().iterator();
	Map.Entry entry;
	while (it.hasNext()) {
	    entry = (Entry) it.next();
	    if (entry.getValue() == value) it.remove();
	}
    }
617075
public static <V> Map<String, V> cleanupMap(Map<String, V> map) {
        if (map == null || map.isEmpty()) {
            return null;
        }

        Map<String, V> result = new HashMap<String, V>(map.size());
        Set<Entry<String, V>> entries = map.entrySet();

        for (Entry<String, V> entry : entries) {
            if (entry.getValue() != null) {
                result.put(entry.getKey(), entry.getValue());
            }
        }

        return result;
    }
1264470
public void removeKey(String key) {
        if (key != null && !key.isEmpty()) {
            for (int i=0; i<map.size(); i++) {
                KeyValue kv = map.get(i);
                if (key.equals(kv.getKey())) {
                    map.remove(i);
                    return;
                }
            }
        }
    }
834695
public static Map<String, Object> beanToMap(Object bean, Map<String, Object> targetMap, final boolean isToUnderlineCase, boolean ignoreNullValue) {
		if (bean == null) {
			return null;
		}

		return beanToMap(bean, targetMap, ignoreNullValue, new Editor<String>() {

			@Override
			public String edit(String key) {
				return isToUnderlineCase ? StrUtil.toUnderlineCase(key) : key;
			}
		});
	}
1138193
public static <K, V> TreeMap<K, V> sort(Map<K, V> map) {
		return sort(map, null);
	}
254723
public IContextMapping<INode> filter(IContextMapping<INode> mapping) throws MappingFilterException {
        //add the first mapping element for the root to the mappings result
        if (0 < mapping.size()) {

            IContext sourceContext = mapping.getSourceContext();
            IContext targetContext = mapping.getTargetContext();

            sourceIndex = new ArrayList<Integer>();
            targetIndex = new ArrayList<Integer>();

            defautlMappings = mapping;

            spsmMapping = mappingFactory.getContextMappingInstance(sourceContext, targetContext);

            spsmMapping.setSimilarity(computeSimilarity(mapping));
            log.info("Similarity: " + spsmMapping.getSimilarity());

            if (isRelated(sourceContext.getRoot(), targetContext.getRoot(), IMappingElement.EQUIVALENCE) ||
                    isRelated(sourceContext.getRoot(), targetContext.getRoot(), IMappingElement.LESS_GENERAL) ||
                    isRelated(sourceContext.getRoot(), targetContext.getRoot(), IMappingElement.MORE_GENERAL)) {

                setStrongestMapping(sourceContext.getRoot(), targetContext.getRoot());
                filterMappingsOfChildren(sourceContext.getRoot(), targetContext.getRoot(), IMappingElement.EQUIVALENCE);
                filterMappingsOfChildren(sourceContext.getRoot(), targetContext.getRoot(), IMappingElement.MORE_GENERAL);
                filterMappingsOfChildren(sourceContext.getRoot(), targetContext.getRoot(), IMappingElement.LESS_GENERAL);
            }

            return spsmMapping;
        }

        return mapping;
    }
834492
public static Object findMapValueByKey(Object key, Map<?, ?> map,
	Object defaultValue)
	{
		if (key == null || map == null)
			return defaultValue;

		Object value = map.get(key);

		if (value == null)
			return defaultValue;

		return value;
	}
1266754
public V get(Map<?, V> map){
		for (Object k : keys){
			V v = map.get(k);
			if (v != null){
				return v;
			}
		}
		return null;
	}
747967
@SuppressWarnings("unchecked")
	public static <K, V> Map<K, V> getAny(Map<K, V> map, final K... keys) {
		return filter(map, new Filter<Entry<K, V>>() {

			@Override
			public boolean accept(Entry<K, V> entry) {
				return ArrayUtil.contains(keys, entry.getKey());
			}
		});
	}
1313830
public static <K, V> Map<K, V> sortNumberMapByKeyDescending(Map<K, V> map) {
        return sortNumberMapByKeyDescending(map.entrySet());
    }
701465
private static void mapToWriter(Map<?, ?> map, JsonWriter writer) throws IOException {
    writer.beginObject();
    for (Map.Entry<?, ?> entry : map.entrySet()) {
      writer.name(String.valueOf(entry.getKey()));
      writeValue(entry.getValue(), writer);
    }
    writer.endObject();
  }
1043946
public static <K, V> TreeMap<K, V> sort(Map<K, V> map, Comparator<? super K> comparator) {
		TreeMap<K, V> result;
		if (map instanceof TreeMap) {
			// 已经是可排序Map，此时只有比较器一致才返回原map
			result = (TreeMap<K, V>) map;
			if (null == comparator || comparator.equals(result.comparator())) {
				return result;
			}
		} else {
			result = newTreeMap(map, comparator);
		}

		return result;
	}