@Override
    public boolean isBlockedTaskManager(ResourceID taskManagerId) {
        assertRunningInMainThread();
        String nodeId = checkNotNull(taskManagerNodeIdRetriever.apply(taskManagerId));
        return blocklistTracker.isBlockedNode(nodeId);
    }
@Test
    void testIsBlockedTaskManager() throws Exception {
        ResourceID resourceID1 = ResourceID.generate();
        ResourceID resourceID2 = ResourceID.generate();
        ResourceID resourceID3 = ResourceID.generate();

        Map<ResourceID, String> taskManagerToNode = new HashMap<>();
        taskManagerToNode.put(resourceID1, "node1");
        taskManagerToNode.put(resourceID2, "node1");
        taskManagerToNode.put(resourceID3, "node2");

        try (DefaultBlocklistHandler handler = createDefaultBlocklistHandler(taskManagerToNode)) {

            handler.addNewBlockedNodes(
                    Collections.singleton(new BlockedNode("node1", "cause", Long.MAX_VALUE)));

            assertThat(handler.isBlockedTaskManager(resourceID1)).isTrue();
            assertThat(handler.isBlockedTaskManager(resourceID2)).isTrue();
            assertThat(handler.isBlockedTaskManager(resourceID3)).isFalse();
        }
    }