@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;
}

@ 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 ; }
2 . using foreach and map . entry
