@Override
    public Collection<BlockedNode> removeTimeoutNodes(long currentTimestamp) {
        Collection<BlockedNode> removedNodes = new ArrayList<>();
        final Iterator<BlockedNode> blockedNodeIterator = blockedNodes.values().iterator();
        while (blockedNodeIterator.hasNext()) {
            BlockedNode blockedNode = blockedNodeIterator.next();
            if (currentTimestamp >= blockedNode.getEndTimestamp()) {
                removedNodes.add(blockedNode);
                blockedNodeIterator.remove();
            }
        }
        return removedNodes;
    }
@Test
    void testRemoveTimeoutNodes() {
        BlockedNode blockedNode1 = new BlockedNode("node1", "cause1", 1L);
        BlockedNode blockedNode2 = new BlockedNode("node2", "cause1", 2L);
        BlockedNode blockedNode3 = new BlockedNode("node3", "cause1", 3L);

        BlocklistTracker blocklistTracker = new DefaultBlocklistTracker();

        blocklistTracker.addNewBlockedNodes(
                Arrays.asList(blockedNode1, blockedNode2, blockedNode3));
        assertThat(blocklistTracker.getAllBlockedNodeIds())
                .containsExactlyInAnyOrder("node1", "node2", "node3");

        Collection<BlockedNode> removedNodes = blocklistTracker.removeTimeoutNodes(2L);
        assertThat(removedNodes).containsExactlyInAnyOrder(blockedNode1, blockedNode2);
        assertThat(blocklistTracker.getAllBlockedNodeIds()).containsExactlyInAnyOrder("node3");
    }