### Question:
ContinuationServiceImpl implements ContinuationService { @Override public void cancel(User user, Device device) { try { logger.info("cancel {} {}", device, user); IContinuation continuation = continuationTransactionMap.getContinuationForDevice(user, device); continuationTransactionMap.delete(user, device); continuation.resume(); } catch (ElementNotFoundException e) { logger.info("cancel device {} for user {} not found", device, user); } } @SuppressWarnings({ "unchecked", "rawtypes" }) @Inject @VisibleForTesting  ContinuationServiceImpl(ContinuationTransactionMap continuationTransactionMap); @Override void suspend(UserDataRequest userDataRequest, IContinuation continuation, long secondsTimeout, String cancellingStatus); @Override void resume(User user, Device device); @Override void cancel(User user, Device device); @Override void running(User user, Device device);  }### Answer:
@Test public void testCancel() throws ElementNotFoundException { IContinuation continuation = mockContinuation(); continuation.resume(); expectLastCall(); ContinuationTransactionMap<IContinuation> continuationTransactionMap = mockContinuationTransactionMap(); expect(continuationTransactionMap.getContinuationForDevice(user, device)) .andReturn(continuation); continuationTransactionMap.delete(user, device); expectLastCall(); control.replay(); continuationService(continuationTransactionMap).cancel(user, device); control.verify(); }