NodeIndices(ClusterSpec.Id cluster, NodeList allNodes) {
        this(allNodes.cluster(cluster).mapToList(node -> node.allocation().get().membership().index()));
    }
@Test
    public void testNodeIndices() {
        NodeIndices indices = new NodeIndices(List.of(1, 3, 4));
        assertEquals(0, indices.probeNext());
        assertEquals(2, indices.probeNext());
        assertEquals(5, indices.probeNext());
        assertEquals(6, indices.probeNext());

        indices.resetProbe();
        assertEquals(0, indices.probeNext());
        assertEquals(2, indices.probeNext());

        indices.commitProbe();
        assertEquals(5, indices.probeNext());
        assertEquals(6, indices.probeNext());

        indices.resetProbe();
        assertEquals(5, indices.next());
        assertEquals(6, indices.next());

        assertEquals(7, indices.probeNext());
        try {
            indices.next();
        }
        catch (IllegalStateException e) {
            assertEquals("Must commit ongoing probe before calling 'next'", e.getMessage());
        }
    }