Program: 130721
Project: 130721
Buggy source:
@Test(timeout=20000) public void testReconfigRecoveryCase3() throws Exception {
  QuorumTestCallback cb1=new QuorumTestCallback();
  QuorumTestCallback cb2=new QuorumTestCallback();
  QuorumTestCallback cb3=new QuorumTestCallback();
  TestStateMachine st=new TestStateMachine();
  final String server1=getUniqueHostPort();
  final String server2=getUniqueHostPort();
  final String server3=getUniqueHostPort();
  Zxid version1=new Zxid(0,1);
  Zxid version2=new Zxid(0,0);
  ArrayList<String> peers1=new ArrayList<String>();
  peers1.add(server1);
  peers1.add(server2);
  ArrayList<String> peers2=new ArrayList<String>();
  peers2.add(server1);
  peers2.add(server2);
  peers2.add(server3);
  ClusterConfiguration cnf1=new ClusterConfiguration(version1,peers1,server1);
  ClusterConfiguration cnf2=new ClusterConfiguration(version2,peers2,server2);
  ClusterConfiguration cnf3=new ClusterConfiguration(version2,peers2,server3);
  Zab.TestState state1=new Zab.TestState(server1,null,getDirectory()).setProposedEpoch(0).setLog(new DummyLog(1)).setAckEpoch(0).setClusterConfiguration(cnf1);
  Zab zab1=new Zab(st,cb1,null,state1);
  Zab.TestState state2=new Zab.TestState(server2,null,getDirectory()).setProposedEpoch(1).setLog(new DummyLog(2)).setAckEpoch(1).setClusterConfiguration(cnf2);
  Zab zab2=new Zab(st,cb2,null,state2);
  Zab.TestState state3=new Zab.TestState(server3,null,getDirectory()).setProposedEpoch(1).setLog(new DummyLog(1)).setAckEpoch(1).setClusterConfiguration(cnf3);
  Zab zab3=new Zab(st,cb3,null,state3);
  cb2.waitBroadcasting();
  cb3.waitBroadcasting();
  Assert.assertEquals(cb2.clusterConfig.getVersion(),cnf2.getVersion());
  Assert.assertEquals(cb3.clusterConfig.getVersion(),cnf3.getVersion());
  Assert.assertEquals(2,cb2.initialHistory.size());
  Assert.assertEquals(2,cb3.initialHistory.size());
  Assert.assertNotEquals(cb2.electedLeader,server1);
  Assert.assertNotEquals(cb3.electedLeader,server1);
  zab1.shutdown();
  zab2.shutdown();
  zab3.shutdown();
}

Fixed version (ground truth):
@Test(timeout=20000) public void testReconfigRecoveryCase3() throws Exception {
  QuorumTestCallback cb1=new QuorumTestCallback();
  QuorumTestCallback cb2=new QuorumTestCallback();
  QuorumTestCallback cb3=new QuorumTestCallback();
  TestStateMachine st=new TestStateMachine();
  final String server1=getUniqueHostPort();
  final String server2=getUniqueHostPort();
  final String server3=getUniqueHostPort();
  Zxid version1=new Zxid(0,1);
  Zxid version2=new Zxid(0,0);
  ArrayList<String> peers1=new ArrayList<String>();
  peers1.add(server1);
  peers1.add(server2);
  ArrayList<String> peers2=new ArrayList<String>();
  peers2.add(server1);
  peers2.add(server2);
  peers2.add(server3);
  ClusterConfiguration cnf1=new ClusterConfiguration(version1,peers1,server1);
  ClusterConfiguration cnf2=new ClusterConfiguration(version2,peers2,server2);
  ClusterConfiguration cnf3=new ClusterConfiguration(version2,peers2,server3);
  Zab.TestState state1=new Zab.TestState(server1,null,getDirectory()).setProposedEpoch(0).setLog(new DummyLog(1)).setAckEpoch(0).setClusterConfiguration(cnf1);
  Zab zab1=new Zab(st,cb1,null,state1);
  Zab.TestState state2=new Zab.TestState(server2,null,getDirectory()).setProposedEpoch(1).setLog(new DummyLog(2)).setAckEpoch(1).setClusterConfiguration(cnf2);
  Zab zab2=new Zab(st,cb2,null,state2);
  Zab.TestState state3=new Zab.TestState(server3,null,getDirectory()).setProposedEpoch(1).setLog(new DummyLog(2)).setAckEpoch(1).setClusterConfiguration(cnf3);
  Zab zab3=new Zab(st,cb3,null,state3);
  cb2.waitBroadcasting();
  cb3.waitBroadcasting();
  Assert.assertEquals(cb2.clusterConfig.getVersion(),cnf2.getVersion());
  Assert.assertEquals(cb3.clusterConfig.getVersion(),cnf3.getVersion());
  Assert.assertEquals(2,cb2.initialHistory.size());
  Assert.assertEquals(2,cb3.initialHistory.size());
  Assert.assertNotEquals(cb2.electedLeader,server1);
  Assert.assertNotEquals(cb3.electedLeader,server1);
  zab1.shutdown();
  zab2.shutdown();
  zab3.shutdown();
}