private void add(Sorted<Integer> sorted, int startIndex, int nrIterations, int[] itemsToAdd) { for (int i = startIndex; i < startIndex + nrIterations; i++) { sleep(); sorted.add(itemsToAdd[i]); } }