@Test public final void testCancellation() throws Exception { final SimpleTask2 task = new SimpleTask2(1); assertFalse("\"cancelled\" must start out set to false!", task.cancelled()); task.cancel(); assertTrue("\"cancelled\" must be true after a call to cancel()!", task.cancelled()); }
@Override public void cancel() { cancelled = true; }
AbstractTask implements Task { @Override public void cancel() { cancelled = true; } }
AbstractTask implements Task { @Override public void cancel() { cancelled = true; }  }
AbstractTask implements Task { @Override public void cancel() { cancelled = true; }  final void setTaskIterator(final TaskIterator taskIterator); TaskIterator getTaskIterator(); @Override abstract void run(TaskMonitor taskMonitor); @Override void cancel(); }
AbstractTask implements Task { @Override public void cancel() { cancelled = true; }  final void setTaskIterator(final TaskIterator taskIterator); TaskIterator getTaskIterator(); @Override abstract void run(TaskMonitor taskMonitor); @Override void cancel();  }