@Override
    @SuppressWarnings({"unchecked", "rawtypes"})
    public void executeUpdate(final LockClusterStatement sqlStatement, final ContextManager contextManager) {
        checkState(contextManager);
        checkAlgorithm(sqlStatement);
        LockContext lockContext = contextManager.getComputeNodeInstanceContext().getLockContext();
        GlobalLockDefinition lockDefinition = new GlobalLockDefinition(GlobalLockNames.CLUSTER_LOCK.getLockName());
        if (lockContext.tryLock(lockDefinition, 3000L)) {
            try {
                checkState(contextManager);
                TypedSPILoader.getService(ClusterLockStrategy.class, sqlStatement.getLockStrategy().getName()).lock();
            } finally {
                lockContext.unlock(lockDefinition);
            }
        }
    }
@Test
    void assertExecuteUpdateWithWrongAlgorithm() {
        ContextManager contextManager = mock(ContextManager.class, RETURNS_DEEP_STUBS);
        when(contextManager.getStateContext().getClusterState()).thenReturn(ClusterState.OK);
        assertThrows(ServiceProviderNotFoundException.class, () -> executor.executeUpdate(new LockClusterStatement(new AlgorithmSegment("FOO", new Properties())), contextManager));
    }