@Override
    public void executeWithLock(Runnable task, LockConfiguration lockConfig) {
        try {
            executeWithLock((Task) task::run, lockConfig);
        } catch (RuntimeException | Error e) {
            throw e;
        } catch (Throwable throwable) {
            // Should not happen
            throw new IllegalStateException(throwable);
        }
    }
@Test
    void shouldExecuteWithResult() throws Throwable {
        mockLockFor(lockConfig);

        TaskResult<String> result = executor.executeWithLock(() -> "result", lockConfig);
        assertThat(result.wasExecuted()).isTrue();
        assertThat(result.getResult()).isEqualTo("result");
    }