@Test public final void testTaskInsertion2() throws Exception { final TaskIterator tasks = new TaskIterator(new SimpleTask2(2), new SimpleTask2(3)); initialTask.insertTasksAfterCurrentTask(tasks); initialTask.insertTasksAfterCurrentTask(new SimpleTask2(4)); final int expectedSequence[] = { 1, 4, 2, 3 }; for (int taskId : expectedSequence) { assertTrue("Invalid task count in iterator!", iter.hasNext()); final Task task = iter.next(); assertEquals("Task ID does not match expected ID!", taskId, ((SimpleTask2)task).getId()); } assertFalse("Invalid task count in iterator!", iter.hasNext()); }
protected final void insertTasksAfterCurrentTask(final Task... newTasks) { taskIterator.insertTasksAfter(this, newTasks); }
AbstractTask implements Task { protected final void insertTasksAfterCurrentTask(final Task... newTasks) { taskIterator.insertTasksAfter(this, newTasks); } }
AbstractTask implements Task { protected final void insertTasksAfterCurrentTask(final Task... newTasks) { taskIterator.insertTasksAfter(this, newTasks); }  }
AbstractTask implements Task { protected final void insertTasksAfterCurrentTask(final Task... newTasks) { taskIterator.insertTasksAfter(this, newTasks); }  final void setTaskIterator(final TaskIterator taskIterator); TaskIterator getTaskIterator(); @Override abstract void run(TaskMonitor taskMonitor); @Override void cancel(); }
AbstractTask implements Task { protected final void insertTasksAfterCurrentTask(final Task... newTasks) { taskIterator.insertTasksAfter(this, newTasks); }  final void setTaskIterator(final TaskIterator taskIterator); TaskIterator getTaskIterator(); @Override abstract void run(TaskMonitor taskMonitor); @Override void cancel();  }