public boolean cancelTimerByCorrelationId(final long correlationId)
    {
        final Timer removedTimer = timerByCorrelationId.remove(correlationId);
        if (null == removedTimer)
        {
            return false;
        }

        final int lastIndex = --size;
        final Timer lastTimer = timers[lastIndex];
        timers[lastIndex] = null;

        if (lastIndex != removedTimer.index)
        {
            shiftDown(timers, lastIndex, removedTimer.index, lastTimer);
            if (timers[removedTimer.index] == lastTimer)
            {
                shiftUp(timers, removedTimer.index, lastTimer);
            }
        }

        addToFreeList(removedTimer);

        return true;
    }
@Test
    void cancelTimerByCorrelationIdIsANoOpIfNoTimersRegistered()
    {
        final PriorityHeapTimerService timerService = new PriorityHeapTimerService(mock(TimerHandler.class));

        assertFalse(timerService.cancelTimerByCorrelationId(100));
    }