cluster.addNode(node2);
TestNode node3 = new TestNode().withCluster("baz", "foo", "bar").withProtocol(protocol);
cluster.addNode(node3);
cluster.start();
node1.await().leaderElected();
Assert.assertTrue(node1.instance().isLeader() || node2.instance().isLeader() || node3.instance().isLeader());
cluster.stop();
}
/**
* Tests that the candidate with the most up-to-date log is elected on startup.