I find it, i could do it like this :
Function<Collection<Integer>, Number> additionFunction = new Function<Collection<Integer>, Number>() {
@Override
public Number apply(Collection<Integer> numbers) {
int sum = 0;
for (Integer number : numbers) {
sum += number;
}
return sum;
}
};
Maps.transformValues(testMultimap.asMap(), additionFunction);
PS : The advantage of using the guava way here, is that we could define multiple functions and then switch between them easily throw the interface Function<Collection<Integer>, Number>
.