@Test
public void aggregateInPlaceBy()
{

    Procedure2<AtomicInteger, Integer> countAggregator = new Procedure2<AtomicInteger, Integer>()
    {
        public void value(AtomicInteger aggregate, Integer value)
        {
            aggregate.incrementAndGet();
        }
    };
    List<Integer> list = Interval.oneTo(2000);
    MutableMap<String, AtomicInteger> aggregation =
            FJIterate.aggregateInPlaceBy(list, EVEN_OR_ODD, ATOMIC_INTEGER_NEW, countAggregator);
    Assert.assertEquals(1000, aggregation.get("Even").intValue());
    Assert.assertEquals(1000, aggregation.get("Odd").intValue());
    FJIterate.aggregateInPlaceBy(list, EVEN_OR_ODD, ATOMIC_INTEGER_NEW, countAggregator, aggregation);
    Assert.assertEquals(2000, aggregation.get("Even").intValue());
    Assert.assertEquals(2000, aggregation.get("Odd").intValue());
}