startProcesses(5);
startProcessesByKey(10, "anotherProcess");
// first processDefinition
HistoricActivityStatisticsQuery query = historyService
.createHistoricActivityStatisticsQuery(processDefinitionId);
List<HistoricActivityStatistics> statistics = query.list();
assertEquals(1, query.count());
assertEquals(1, statistics.size());
HistoricActivityStatistics task = statistics.get(0);
assertEquals(5, task.getInstances());
// second processDefinition
query = historyService
.createHistoricActivityStatisticsQuery(anotherProcessDefinitionId);
statistics = query.list();
assertEquals(1, query.count());
assertEquals(1, statistics.size());
task = statistics.get(0);
assertEquals(10, task.getInstances());