@Override
    public void stopTrackingAndReleaseJobPartitionsFor(JobID producingJobId) {
        Collection<ResultPartitionID> partitionsForJob =
                CollectionUtil.project(
                        stopTrackingPartitionsFor(producingJobId),
                        PartitionTrackerEntry::getResultPartitionId);
        LOG.debug("Releasing Job Partitions {} for job {}", partitionsForJob, producingJobId);
        shuffleEnvironment.releasePartitionsLocally(partitionsForJob);
    }
@Test
    void testStopTrackingAndReleaseJobPartitionsFor() throws Exception {
        final TestingShuffleEnvironment testingShuffleEnvironment = new TestingShuffleEnvironment();
        final CompletableFuture<Collection<ResultPartitionID>> shuffleReleaseFuture =
                new CompletableFuture<>();
        testingShuffleEnvironment.releasePartitionsLocallyFuture = shuffleReleaseFuture;

        final JobID jobId1 = new JobID();
        final JobID jobId2 = new JobID();
        final ResultPartitionID resultPartitionId1 = new ResultPartitionID();
        final ResultPartitionID resultPartitionId2 = new ResultPartitionID();

        final TaskExecutorPartitionTracker partitionTracker =
                new TaskExecutorPartitionTrackerImpl(testingShuffleEnvironment);
        partitionTracker.startTrackingPartition(
                jobId1,
                new TaskExecutorPartitionInfo(
                        new TestingShuffleDescriptor(resultPartitionId1),
                        new IntermediateDataSetID(),
                        1));
        partitionTracker.startTrackingPartition(
                jobId2,
                new TaskExecutorPartitionInfo(
                        new TestingShuffleDescriptor(resultPartitionId2),
                        new IntermediateDataSetID(),
                        1));
        partitionTracker.stopTrackingAndReleaseJobPartitionsFor(jobId1);

        assertThatFuture(shuffleReleaseFuture)
                .eventuallySucceeds()
                .asList()
                .contains(resultPartitionId1);
    }