newSum.add(sums[1]);
return new SumResult(newSum);
} else if (resultsToAdd instanceof CountResult) {
//SumResult + CountResult = AverageResult
int count = resultsToAdd.toInt();
AverageResult newResult = new AverageResult(count, sum.getResult());
return newResult;
} else {
throw new IllegalArgumentException(
"The CalcResults claim to be compatible, but the appropriate merge method has not been implemented.");