public static ResourceProfile generateTaskManagerTotalResourceProfile(
            WorkerResourceSpec workerResourceSpec) {
        return ResourceProfile.newBuilder()
                .setCpuCores(workerResourceSpec.getCpuCores())
                .setTaskHeapMemory(workerResourceSpec.getTaskHeapSize())
                .setTaskOffHeapMemory(workerResourceSpec.getTaskOffHeapSize())
                .setManagedMemory(workerResourceSpec.getManagedMemSize())
                .setNetworkMemory(workerResourceSpec.getNetworkMemSize())
                .setExtendedResources(workerResourceSpec.getExtendedResources().values())
                .build();
    }
@Test
    void testGenerateTaskManagerTotalResourceProfile() {
        final ResourceProfile resourceProfile =
                ResourceProfile.newBuilder()
                        .setCpuCores(1.0)
                        .setTaskHeapMemoryMB(1)
                        .setTaskOffHeapMemoryMB(2)
                        .setNetworkMemoryMB(3)
                        .setManagedMemoryMB(4)
                        .setExtendedResource(new ExternalResource(EXTERNAL_RESOURCE_NAME, 1))
                        .build();
        final WorkerResourceSpec workerResourceSpec =
                new WorkerResourceSpec.Builder()
                        .setCpuCores(1.0)
                        .setTaskHeapMemoryMB(1)
                        .setTaskOffHeapMemoryMB(2)
                        .setNetworkMemoryMB(3)
                        .setManagedMemoryMB(4)
                        .setExtendedResource(new ExternalResource(EXTERNAL_RESOURCE_NAME, 1))
                        .build();

        assertThat(SlotManagerUtils.generateTaskManagerTotalResourceProfile(workerResourceSpec))
                .isEqualTo(resourceProfile);
    }