@Override
    public Map<ExecutionAttemptID, ExecutionSlotAssignment> allocateSlotsFor(
            List<ExecutionAttemptID> executionAttemptIds) {

        final Map<ExecutionVertexID, ExecutionAttemptID> vertexIdToExecutionId = new HashMap<>();
        executionAttemptIds.forEach(
                executionId ->
                        vertexIdToExecutionId.put(executionId.getExecutionVertexId(), executionId));

        checkState(
                vertexIdToExecutionId.size() == executionAttemptIds.size(),
                "SlotSharingExecutionSlotAllocator does not support one execution vertex to have multiple concurrent executions");

        final List<ExecutionVertexID> vertexIds =
                executionAttemptIds.stream()
                        .map(ExecutionAttemptID::getExecutionVertexId)
                        .collect(Collectors.toList());

        return allocateSlotsForVertices(vertexIds).stream()
                .collect(
                        Collectors.toMap(
                                vertexAssignment ->
                                        vertexIdToExecutionId.get(
                                                vertexAssignment.getExecutionVertexId()),
                                vertexAssignment ->
                                        new ExecutionSlotAssignment(
                                                vertexIdToExecutionId.get(
                                                        vertexAssignment.getExecutionVertexId()),
                                                vertexAssignment.getLogicalSlotFuture())));
    }
@Test
    void testSlotRequestProfileFromExecutionSlotSharingGroup() {
        final ResourceProfile resourceProfile1 = ResourceProfile.fromResources(1, 10);
        final ResourceProfile resourceProfile2 = ResourceProfile.fromResources(2, 20);
        final AllocationContext context =
                AllocationContext.newBuilder()
                        .addGroupAndResource(resourceProfile1, EV1, EV3)
                        .addGroupAndResource(resourceProfile2, EV2, EV4)
                        .build();

        context.allocateSlotsFor(EV1, EV2);
        assertThat(context.getSlotProvider().getRequests()).hasSize(2);

        assertThat(
                        context.getSlotProvider().getRequests().values().stream()
                                .map(PhysicalSlotRequest::getSlotProfile)
                                .map(SlotProfile::getPhysicalSlotResourceProfile)
                                .collect(Collectors.toList()))
                .containsExactlyInAnyOrder(resourceProfile1, resourceProfile2);
    }