public static void extendActiveLock(Duration lockAtMostFor, Duration lockAtLeastFor) {
        SimpleLock lock = locks().peekLast();
        if (lock == null) throw new NoActiveLockException();
        Optional<SimpleLock> newLock = lock.extend(lockAtMostFor, lockAtLeastFor);
        if (newLock.isPresent()) {
            // removing and adding here should be safe as it's a thread local variable and
            // the changes are
            // only visible in the current thread.
            locks().removeLast();
            locks().addLast(newLock.get());
        } else {
            throw new LockCanNotBeExtendedException();
        }
    }
@Test
    void shouldFailIfNoActiveLock() {
        assertThatThrownBy(() -> LockExtender.extendActiveLock(ofSeconds(1), ofSeconds(0)))
                .isInstanceOf(NoActiveLockException.class);
    }