RestRequestCancellationRegistry { public boolean cancel(String requestId, Object userId) { if (requestId == null) { return false; } RequestCancellationInfo cancellationInfo = getRequestCancellationInfos().get(requestId); if (cancellationInfo == null) { LOG.debug("Cancellation item does not exist [requestId={}]", requestId); return false; } if (!checkAccess(userId, cancellationInfo)) { LOG.info("Cannot cancel requests of other users [requestId={}, executingUserId={}, requestingUserId={}]", requestId, cancellationInfo.getUserId(), userId); throw new AccessForbiddenException(); } return cancellationInfo.getRunMonitor().cancel(true); }  IRegistrationHandle register(String requestId, Object userId, RunMonitor runMonitor); boolean cancel(String requestId, Object userId);  }
@Test public void testCancel() { assertFalse(m_registry.cancel(null, null)); assertFalse(m_registry.cancel("1", null)); }