@Override
    public void removeTaskManager(InstanceID instanceId) {
        Preconditions.checkNotNull(instanceId);
        unWantedTaskManagers.remove(instanceId);
        final FineGrainedTaskManagerRegistration taskManager =
                Preconditions.checkNotNull(taskManagerRegistrations.remove(instanceId));
        totalRegisteredResource = totalRegisteredResource.subtract(taskManager.getTotalResource());
        LOG.debug("Remove task manager {}.", instanceId);
        for (AllocationID allocationId : taskManager.getAllocatedSlots().keySet()) {
            slots.remove(allocationId);
        }
    }
@Test
    void testRemoveUnknownTaskManager() {
        assertThatThrownBy(
                        () -> {
                            final FineGrainedTaskManagerTracker taskManagerTracker =
                                    new FineGrainedTaskManagerTracker();
                            taskManagerTracker.removeTaskManager(new InstanceID());
                        })
                .isInstanceOf(NullPointerException.class);
    }