@Test
public void testAggregateHistoricalStatistics(){

	
	//given
	List<List<Statistics>> history = generateStatisticHistory();
	
	//when
	Collection<Statistics> aggregatedHistory = StatisticsService.aggregateHistoricalStatistics(history);
	
	//then
	Assert.assertNotNull(aggregatedHistory);
	Assert.assertEquals(3, aggregatedHistory.size());
	
	Iterator<Statistics> iter = aggregatedHistory.iterator();
	
	//check the first aggregated record
	checkStatisticsRecord(history, 0, iter.next());
	
	//check the second aggregated record
	checkStatisticsRecord(history, 1, iter.next());
	
	//check the second aggregated record
	checkStatisticsRecord(history, 2, iter.next());
}