public static TaskExecutorProcessSpec processSpecFromConfig(final Configuration config) {
        try {
            return createMemoryProcessSpec(
                    config, PROCESS_MEMORY_UTILS.memoryProcessSpecFromConfig(config));
        } catch (IllegalConfigurationException e) {
            throw new IllegalConfigurationException(
                    "TaskManager memory configuration failed: " + e.getMessage(), e);
        }
    }
@Test
    void testProcessSpecFromConfigWithExternalResource() {
        final Configuration config = new Configuration();
        config.setString(
                ExternalResourceOptions.EXTERNAL_RESOURCE_LIST.key(), EXTERNAL_RESOURCE_NAME_1);
        config.setLong(
                ExternalResourceOptions.getAmountConfigOptionForResource(EXTERNAL_RESOURCE_NAME_1),
                1);
        config.set(TaskManagerOptions.TOTAL_PROCESS_MEMORY, MemorySize.ofMebiBytes(4096));
        final TaskExecutorProcessSpec taskExecutorProcessSpec =
                TaskExecutorProcessUtils.processSpecFromConfig(config);
        assertThat(taskExecutorProcessSpec.getExtendedResources()).hasSize(1);
        assertThat(
                        taskExecutorProcessSpec
                                .getExtendedResources()
                                .get(EXTERNAL_RESOURCE_NAME_1)
                                .getValue()
                                .longValue())
                .isOne();
    }