MapReduceResult result = MapReduceResult.class.cast(count);
int[] chars = toChars(payloads);
Counters counters = result.getCounters();
for (int i = 0; i < chars.length; i++) {
char ch = (char) ('a' + i);
Counter c = counters.getCounter(CountMapper.toKey(ch));
Assert.assertEquals(String.format("Invalid count for '%s'.", ch), chars[i], c.getValue());
}
}