Program: 49732
Project: 49732
Buggy source:
@Test public void splitBrain() throws Exception {
  boolean multicast=true;
  Config c1=new Config();
  c1.getNetworkConfig().getJoin().getMulticastConfig().setEnabled(multicast);
  c1.getNetworkConfig().getJoin().getTcpIpConfig().setEnabled(!multicast);
  c1.getNetworkConfig().getJoin().getTcpIpConfig().addMember("String_Node_Str");
  c1.getNetworkConfig().getInterfaces().clear();
  c1.getNetworkConfig().getInterfaces().addInterface("String_Node_Str");
  c1.getNetworkConfig().getInterfaces().setEnabled(true);
  Config c2=new Config();
  c2.getNetworkConfig().getJoin().getMulticastConfig().setEnabled(multicast);
  c2.getNetworkConfig().getJoin().getTcpIpConfig().setEnabled(!multicast);
  c2.getNetworkConfig().getJoin().getTcpIpConfig().addMember("String_Node_Str");
  c2.getNetworkConfig().getInterfaces().clear();
  c2.getNetworkConfig().getInterfaces().addInterface("String_Node_Str");
  c2.getNetworkConfig().getInterfaces().setEnabled(true);
  c1.getGroupConfig().setName("String_Node_Str");
  c2.getGroupConfig().setName("String_Node_Str");
  c1.setProperty(GroupProperties.PROP_MERGE_FIRST_RUN_DELAY_SECONDS,"String_Node_Str");
  c1.setProperty(GroupProperties.PROP_MERGE_NEXT_RUN_DELAY_SECONDS,"String_Node_Str");
  c2.setProperty(GroupProperties.PROP_MERGE_FIRST_RUN_DELAY_SECONDS,"String_Node_Str");
  c2.setProperty(GroupProperties.PROP_MERGE_NEXT_RUN_DELAY_SECONDS,"String_Node_Str");
  HazelcastInstance h1=Hazelcast.newHazelcastInstance(c1);
  HazelcastInstance h2=Hazelcast.newHazelcastInstance(c2);
  HazelcastClient client2=HazelcastClient.newHazelcastClient(c2.getGroupConfig().getName(),c2.getGroupConfig().getPassword(),"String_Node_Str");
  client2.getTopic("String_Node_Str").addMessageListener(new MessageListener<Object>(){
    public void onMessage(    Object message){
    }
  }
);
  LifecycleCountingListener l=new LifecycleCountingListener();
  h2.getLifecycleService().addLifecycleListener(l);
  for (int i=0; i < 500; i++) {
    h2.getMap("String_Node_Str").put(i,"String_Node_Str" + i);
    h2.getMultiMap("String_Node_Str").put(i,"String_Node_Str" + i);
    h2.getMultiMap("String_Node_Str").put(i,"String_Node_Str" + i);
  }
  assertEquals(500,h2.getMap("String_Node_Str").size());
  assertEquals(1000,h2.getMultiMap("String_Node_Str").size());
  assertEquals(1,h1.getCluster().getMembers().size());
  assertEquals(1,h2.getCluster().getMembers().size());
  Thread.sleep(2000);
  c1.getGroupConfig().setName("String_Node_Str");
  assertTrue(l.waitFor(LifecycleEvent.LifecycleState.RESTARTED,40));
  assertEquals(1,l.getCount(LifecycleEvent.LifecycleState.RESTARTING));
  assertEquals(1,l.getCount(LifecycleEvent.LifecycleState.RESTARTED));
  assertEquals(2,h1.getCluster().getMembers().size());
  assertEquals(2,h2.getCluster().getMembers().size());
  assertEquals(500,h1.getMap("String_Node_Str").size());
  assertEquals(500,h2.getMap("String_Node_Str").size());
  assertEquals(1000,h2.getMultiMap("String_Node_Str").size());
  assertEquals(1000,h1.getMultiMap("String_Node_Str").size());
  Thread.sleep(10000);
}

Fixed version (ground truth):
@Test public void splitBrain() throws Exception {
  boolean multicast=true;
  Config c1=new Config();
  c1.getNetworkConfig().getJoin().getMulticastConfig().setEnabled(multicast);
  c1.getNetworkConfig().getJoin().getTcpIpConfig().setEnabled(!multicast);
  c1.getNetworkConfig().getJoin().getTcpIpConfig().addMember("String_Node_Str");
  c1.getNetworkConfig().getInterfaces().clear();
  c1.getNetworkConfig().getInterfaces().addInterface("String_Node_Str");
  c1.getNetworkConfig().getInterfaces().setEnabled(true);
  Config c2=new Config();
  c2.getNetworkConfig().getJoin().getMulticastConfig().setEnabled(multicast);
  c2.getNetworkConfig().getJoin().getTcpIpConfig().setEnabled(!multicast);
  c2.getNetworkConfig().getJoin().getTcpIpConfig().addMember("String_Node_Str");
  c2.getNetworkConfig().getInterfaces().clear();
  c2.getNetworkConfig().getInterfaces().addInterface("String_Node_Str");
  c2.getNetworkConfig().getInterfaces().setEnabled(true);
  c1.getGroupConfig().setName("String_Node_Str");
  c2.getGroupConfig().setName("String_Node_Str");
  c1.setProperty(GroupProperties.PROP_MERGE_FIRST_RUN_DELAY_SECONDS,"String_Node_Str");
  c1.setProperty(GroupProperties.PROP_MERGE_NEXT_RUN_DELAY_SECONDS,"String_Node_Str");
  c2.setProperty(GroupProperties.PROP_MERGE_FIRST_RUN_DELAY_SECONDS,"String_Node_Str");
  c2.setProperty(GroupProperties.PROP_MERGE_NEXT_RUN_DELAY_SECONDS,"String_Node_Str");
  HazelcastInstance h1=Hazelcast.newHazelcastInstance(c1);
  HazelcastInstance h2=Hazelcast.newHazelcastInstance(c2);
  HazelcastClient client2=HazelcastClient.newHazelcastClient(c2.getGroupConfig().getName(),c2.getGroupConfig().getPassword(),"String_Node_Str");
  client2.getTopic("String_Node_Str").addMessageListener(new MessageListener<Object>(){
    public void onMessage(    Message message){
    }
  }
);
  LifecycleCountingListener l=new LifecycleCountingListener();
  h2.getLifecycleService().addLifecycleListener(l);
  for (int i=0; i < 500; i++) {
    h2.getMap("String_Node_Str").put(i,"String_Node_Str" + i);
    h2.getMultiMap("String_Node_Str").put(i,"String_Node_Str" + i);
    h2.getMultiMap("String_Node_Str").put(i,"String_Node_Str" + i);
  }
  assertEquals(500,h2.getMap("String_Node_Str").size());
  assertEquals(1000,h2.getMultiMap("String_Node_Str").size());
  assertEquals(1,h1.getCluster().getMembers().size());
  assertEquals(1,h2.getCluster().getMembers().size());
  Thread.sleep(2000);
  c1.getGroupConfig().setName("String_Node_Str");
  assertTrue(l.waitFor(LifecycleEvent.LifecycleState.RESTARTED,40));
  assertEquals(1,l.getCount(LifecycleEvent.LifecycleState.RESTARTING));
  assertEquals(1,l.getCount(LifecycleEvent.LifecycleState.RESTARTED));
  assertEquals(2,h1.getCluster().getMembers().size());
  assertEquals(2,h2.getCluster().getMembers().size());
  assertEquals(500,h1.getMap("String_Node_Str").size());
  assertEquals(500,h2.getMap("String_Node_Str").size());
  assertEquals(1000,h2.getMultiMap("String_Node_Str").size());
  assertEquals(1000,h1.getMultiMap("String_Node_Str").size());
  Thread.sleep(10000);
}