public void testMajQuorums() throws Throwable {
//setup servers 1-5 to be followers
setUp(false);
Proposal p = new Proposal();
p.addQuorumVerifier(s1.getQuorumVerifier());
// 2 followers out of 5 is not a majority
p.addAck(Long.valueOf(1));
p.addAck(Long.valueOf(2));
Assert.assertEquals(false, p.hasAllQuorums());
// 6 is not in the view - its vote shouldn't count
p.addAck(Long.valueOf(6));
Assert.assertEquals(false, p.hasAllQuorums());
// 3 followers out of 5 are a majority of the voting view
p.addAck(Long.valueOf(3));
Assert.assertEquals(true, p.hasAllQuorums());
//setup servers 1-3 to be followers and 4 and 5 to be observers
setUp(true);
p = new Proposal();
p.addQuorumVerifier(s1.getQuorumVerifier());
// 1 follower out of 3 is not a majority
p.addAck(Long.valueOf(1));
Assert.assertEquals(false, p.hasAllQuorums());
// 4 and 5 are observers, their vote shouldn't count
p.addAck(Long.valueOf(4));
p.addAck(Long.valueOf(5));
Assert.assertEquals(false, p.hasAllQuorums());
// 6 is not in the view - its vote shouldn't count
p.addAck(Long.valueOf(6));
Assert.assertEquals(false, p.hasAllQuorums());
// 2 followers out of 3 are a majority of the voting view
p.addAck(Long.valueOf(2));
Assert.assertEquals(true, p.hasAllQuorums());
}