AfterCompletion { public synchronized void cancel() { action = Action.CANCEL; signalAndWaitForDoOp(); }  synchronized void doOp(TXState txState, CancelCriterion cancelCriterion); void executeCommit(); void executeRollback(); synchronized void cancel(); synchronized boolean isStarted();  }
@Test public void cancelCallsDoCleanup() { startDoOp(); afterCompletion.cancel(); verifyDoOpFinished(); verify(txState).doCleanup(); }