question: @ Benchmark public long test2_UsingForEachAndMapEntry ( ) throws IOException { long i = 0 ; for ( Map . Entry < Integer , Integer > pair : map . entrySet ( ) ) { i += pair . getKey ( ) + pair . getValue ( ) ; } return i ; }
target:  2. Using foreach and Map.Entry 