@Override
    public Map<JobID, ResourceCounter> removePendingTaskManager(
            PendingTaskManagerId pendingTaskManagerId) {
        Preconditions.checkNotNull(pendingTaskManagerId);
        final PendingTaskManager pendingTaskManager =
                Preconditions.checkNotNull(pendingTaskManagers.remove(pendingTaskManagerId));
        totalPendingResource =
                totalPendingResource.subtract(pendingTaskManager.getTotalResourceProfile());
        LOG.debug("Remove pending task manager {}.", pendingTaskManagerId);
        totalAndDefaultSlotProfilesToPendingTaskManagers.compute(
                Tuple2.of(
                        pendingTaskManager.getTotalResourceProfile(),
                        pendingTaskManager.getDefaultSlotResourceProfile()),
                (ignored, pendingTMSet) -> {
                    Preconditions.checkNotNull(pendingTMSet).remove(pendingTaskManager);
                    return pendingTMSet.isEmpty() ? null : pendingTMSet;
                });
        return pendingTaskManager.getPendingSlotAllocationRecords();
    }
@Test
    void testRemoveUnknownPendingTaskManager() {
        assertThatThrownBy(
                        () -> {
                            final FineGrainedTaskManagerTracker taskManagerTracker =
                                    new FineGrainedTaskManagerTracker();

                            taskManagerTracker.removePendingTaskManager(
                                    PendingTaskManagerId.generate());
                        })
                .isInstanceOf(NullPointerException.class);
    }