@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 testSlotProfileRequestAskedBulkAndGroup() {
        AllocationContext context = AllocationContext.newBuilder().addGroup(EV1, EV2).build();
        ExecutionSlotSharingGroup executionSlotSharingGroup =
                context.getSlotSharingStrategy().getExecutionSlotSharingGroup(EV1);

        context.allocateSlotsFor(EV1, EV2);

        List<Set<ExecutionVertexID>> askedBulks =
                context.getSlotProfileRetrieverFactory().getAskedBulks();
        assertThat(askedBulks).hasSize(1);
        assertThat(askedBulks.get(0)).containsExactlyInAnyOrder(EV1, EV2);
        assertThat(context.getSlotProfileRetrieverFactory().getAskedGroups())
                .containsExactly(executionSlotSharingGroup);
    }