我想使用java Stream迭代hashmap,并希望为每个键执行一个内联函数然后求和]
Map<Integer, Integer> myMap= new HashMap<Integer, Integer>() {{
put(5000, 0);
put(1000, 10);
}};
myMap.entrySet().stream().map(e-> {/* want to fetch the corresponding value and increment by X and find the sum*/ });