/**
* 取两个Map集合的交集(将map1的值赋给resultMap)
*
* @param map1 (有值)
* @param map2 (没值)
* @return 两个集合的交集
*/
public static Map<String, Object> getMapJiaoJi(Map<String, Object> map1, Map<String, Object> map2) {
Set<String> bigMapKey = map1.keySet();
Set<String> smallMapKey = map2.keySet();
Set<String> differenceSet = Sets.intersection(bigMapKey, smallMapKey);
Map<String, Object> resultMap = Maps.newHashMap();
for (String key : differenceSet) {
resultMap.put(key, map1.get(key));
}
return resultMap;
}