static int getDefaultMaxParallelism(
            Configuration configuration, ExecutionConfig executionConfig) {
        return configuration
                .getOptional(BatchExecutionOptions.ADAPTIVE_AUTO_PARALLELISM_MAX_PARALLELISM)
                .orElse(
                        executionConfig.getParallelism() == ExecutionConfig.PARALLELISM_DEFAULT
                                ? BatchExecutionOptions.ADAPTIVE_AUTO_PARALLELISM_MAX_PARALLELISM
                                        .defaultValue()
                                : executionConfig.getParallelism());
    }
@Test
    void testMaxParallelismFallsBackToExecutionConfigDefaultParallelism() {
        Configuration configuration = new Configuration();
        ExecutionConfig executionConfig = new ExecutionConfig();
        executionConfig.setParallelism(5);
        assertThat(
                        AdaptiveBatchSchedulerFactory.getDefaultMaxParallelism(
                                configuration, executionConfig))
                .isEqualTo(5);
    }