public void run() {
   try {
     this.procedure = this.procedureFactory.create();
     int stop = this.end - 1;
     if (this.list instanceof MutableList) {
       ((MutableList<T>) this.list).forEachWithIndex(this.start, stop, this.procedure);
     } else if (this.list instanceof ArrayList) {
       ArrayListIterate.forEachWithIndex(
           (ArrayList<T>) this.list, this.start, stop, this.procedure);
     } else {
       ListIterate.forEachWithIndex(this.list, this.start, stop, this.procedure);
     }
   } catch (Exception newError) {
     this.taskRunner.setFailed(newError);
   } finally {
     this.taskRunner.taskCompleted(this);
   }
 }