@Override
    public Optional<SimpleLock> lock(LockConfiguration lockConfiguration) {
        if (lockConfiguration.getLockAtMostFor().compareTo(minimalLockAtMostFor) < 0) {
            throw new IllegalArgumentException(
                    "Can not use KeepAliveLockProvider with lockAtMostFor shorter than " + minimalLockAtMostFor);
        }
        Optional<SimpleLock> lock = wrapped.lock(lockConfiguration);
        return lock.map(simpleLock -> new KeepAliveLock(lockConfiguration, simpleLock, executorService));
    }
@Test
    void shouldCancelIfCanNotExtend() {
        mockExtension(originalLock, Optional.empty());

        Optional<SimpleLock> lock = provider.lock(lockConfiguration);
        assertThat(lock).isNotNull();
        tickMs(1_500);
        verify(originalLock).extend(lockConfiguration.getLockAtMostFor(), ofMillis(500));
        tickMs(10_000);
        verifyNoMoreInteractions(originalLock);
    }