for (List<Statistics> threadStats : ack.iterations) {
if (test != null) {
String iterationValue = resolveIterationValue();</BUG>
if (iterationValue != null) {
<BUG>test.setIterationValue(i, iterationValue);
</BUG>
}
<BUG>test.addStatistics(i++, ack.getSlaveIndex(), threadStats);

}
threads = Math.max(threads, threadStats.size());</BUG>
}

List<StatisticsAck> statisticsAcks = instancesOf(acks, StatisticsAck.class);
Statistics aggregated = statisticsAcks.stream().flatMap(ack -> ack.statistics.stream()).reduce(null, Statistics.MERGE);
for (StatisticsAck ack : statisticsAcks) {
if (ack.statistics != null) {
if (test != null) {
int testIteration = getTestIteration();
String iterationValue = resolveIterationValue();
if (iterationValue != null) {
test.setIterationValue(testIteration, iterationValue);
}
test.addStatistics(testIteration, ack.getSlaveIndex(), ack.statistics);
}
