@Test
public void testForEachUsingMap()
{

    //Test the default batch size calculations
    IntegerSum sum1 = new IntegerSum(0);
    MutableMap<String, Integer> map1 = Interval.fromTo(1, 100).toMap(Functions.getToString(), Functions.getIntegerPassThru());
    FJIterate.forEach(map1, new SumProcedure(sum1), new SumCombiner(sum1));
    Assert.assertEquals(5050, sum1.getSum());
    //Testing batch size 1
    IntegerSum sum2 = new IntegerSum(0);
    UnifiedMap<String, Integer> map2 = (UnifiedMap<String, Integer>) Interval.fromTo(1, 100).toMap(Functions.getToString(), Functions.getIntegerPassThru());
    FJIterate.forEach(map2, new SumProcedure(sum2), new SumCombiner(sum2), 1, map2.getBatchCount(map2.size()));
    Assert.assertEquals(5050, sum2.getSum());
    //Testing an uneven batch size
    IntegerSum sum3 = new IntegerSum(0);
    UnifiedMap<String, Integer> set3 = (UnifiedMap<String, Integer>) Interval.fromTo(1, 100).toMap(Functions.getToString(), Functions.getIntegerPassThru());
    FJIterate.forEach(set3, new SumProcedure(sum3), new SumCombiner(sum3), 1, set3.getBatchCount(13));
    Assert.assertEquals(5050, sum3.getSum());
}