public static RestartBackoffTimeStrategy.Factory createRestartBackoffTimeStrategyFactory(
            final RestartStrategies.RestartStrategyConfiguration jobRestartStrategyConfiguration,
            final Configuration jobConfiguration,
            final Configuration clusterConfiguration,
            final boolean isCheckpointingEnabled) {

        checkNotNull(jobRestartStrategyConfiguration);
        checkNotNull(jobConfiguration);
        checkNotNull(clusterConfiguration);

        return getJobRestartStrategyFactory(jobRestartStrategyConfiguration)
                .orElse(
                        getRestartStrategyFactoryFromConfig(jobConfiguration)
                                .orElse(
                                        (getRestartStrategyFactoryFromConfig(clusterConfiguration)
                                                .orElse(
                                                        getDefaultRestartStrategyFactory(
                                                                isCheckpointingEnabled)))));
    }
@Test
    void testNoStrategySpecifiedWhenCheckpointingEnabled() {
        final RestartBackoffTimeStrategy.Factory factory =
                RestartBackoffTimeStrategyFactoryLoader.createRestartBackoffTimeStrategyFactory(
                        DEFAULT_JOB_LEVEL_RESTART_CONFIGURATION,
                        new Configuration(),
                        new Configuration(),
                        true);

        RestartBackoffTimeStrategy strategy = factory.create();
        assertThat(strategy).isInstanceOf(ExponentialDelayRestartBackoffTimeStrategy.class);

        ExponentialDelayRestartBackoffTimeStrategy exponentialDelayStrategy =
                (ExponentialDelayRestartBackoffTimeStrategy) strategy;

        assertThat(exponentialDelayStrategy.getInitialBackoffMS())
                .isEqualTo(
                        RestartStrategyOptions.RESTART_STRATEGY_EXPONENTIAL_DELAY_INITIAL_BACKOFF
                                .defaultValue()
                                .toMillis());
        assertThat(exponentialDelayStrategy.getMaxBackoffMS())
                .isEqualTo(
                        RestartStrategyOptions.RESTART_STRATEGY_EXPONENTIAL_DELAY_MAX_BACKOFF
                                .defaultValue()
                                .toMillis());
        assertThat(exponentialDelayStrategy.getBackoffMultiplier())
                .isEqualTo(
                        RestartStrategyOptions.RESTART_STRATEGY_EXPONENTIAL_DELAY_BACKOFF_MULTIPLIER
                                .defaultValue());
        assertThat(exponentialDelayStrategy.getResetBackoffThresholdMS())
                .isEqualTo(
                        RestartStrategyOptions
                                .RESTART_STRATEGY_EXPONENTIAL_DELAY_RESET_BACKOFF_THRESHOLD
                                .defaultValue()
                                .toMillis());
        assertThat(exponentialDelayStrategy.getJitterFactor())
                .isEqualTo(
                        RestartStrategyOptions.RESTART_STRATEGY_EXPONENTIAL_DELAY_JITTER_FACTOR
                                .defaultValue());
        assertThat(exponentialDelayStrategy.getAttemptsBeforeResetBackoff())
                .isEqualTo(
                        RestartStrategyOptions.RESTART_STRATEGY_EXPONENTIAL_DELAY_ATTEMPTS
                                .defaultValue());
    }