@Test
    void testSetAllTimestampsAfterDowntime() throws Exception {
        FleetControllerOptions.Builder options = defaultOptions();
        setUpFleetController(timer, options);
        setUpVdsNodes(timer);
        waitForStableSystem();

        StateWaiter waiter = new StateWaiter(timer);
        fleetController().addSystemStateListener(waiter);

        // Simulate netsplit. Take node down without node booting
        assertTrue(nodes.get(0).isDistributor());
        nodes.get(0).disconnectImmediately();
        waiter.waitForState("version:\\d+ distributor:10 .0.s:d storage:10", timeout());

        // Add node back.
        nodes.get(0).connect();
        waitForStableSystem();

        // At this time, node taken down should have cluster states with all starting timestamps set. Others node should not.
        for (DummyVdsNode node : nodes) {
            node.waitForSystemStateVersion(waiter.getCurrentSystemState().getVersion(), timeout());
            List<ClusterState> states = node.getSystemStatesReceived();
            ClusterState lastState = states.get(0);
            StringBuilder stateHistory = new StringBuilder();
            for (ClusterState state : states) {
                stateHistory.append(state.toString()).append("\n");
            }

            if (node.getNode().equals(new Node(NodeType.DISTRIBUTOR, 0))) {
                for (ConfiguredNode i : options.nodes()) {
                    Node nodeId = new Node(NodeType.STORAGE, i.index());
                    long ts = lastState.getNodeState(nodeId).getStartTimestamp();
                    assertTrue(ts > 0, nodeId + "\n" + stateHistory + "\nWas " + ts + " should be " + fleetController().getCluster().getNodeInfo(nodeId).getStartTimestamp());
                }
            } else {
                for (ConfiguredNode i : options.nodes()) {
                    Node nodeId = new Node(NodeType.STORAGE, i.index());
                    assertEquals(0, lastState.getNodeState(nodeId).getStartTimestamp(), nodeId.toString());
                }
            }

            for (ConfiguredNode i : options.nodes()) {
                Node nodeId = new Node(NodeType.DISTRIBUTOR, i.index());
                assertEquals(0, lastState.getNodeState(nodeId).getStartTimestamp(), nodeId.toString());
            }
        }
    }
Class for testing states of all nodes. Will fail in constructor with
debug message on non-expected results.
clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/StateChangeTest.java