Program: 49806
Project: 49806
Buggy source:
@Test(timeout=60000) public void testSuperClientRestart() throws Exception {
  Config configNormal=new Config();
  Config configSuper=new Config();
  configSuper.setSuperClient(true);
  HazelcastInstance h=Hazelcast.newHazelcastInstance(configNormal);
  HazelcastInstance s=Hazelcast.newHazelcastInstance(configSuper);
  assertEquals(2,h.getCluster().getMembers().size());
  assertEquals(2,s.getCluster().getMembers().size());
  assertFalse(h.getCluster().getLocalMember().isSuperClient());
  assertTrue(s.getCluster().getLocalMember().isSuperClient());
  IMap map=h.getMap("String_Node_Str");
  final IMap maps=s.getMap("String_Node_Str");
  assertNull(map.put("String_Node_Str","String_Node_Str"));
  assertEquals("String_Node_Str",map.get("String_Node_Str"));
  assertEquals("String_Node_Str",maps.get("String_Node_Str"));
  assertEquals(1,map.size());
  assertEquals(1,maps.size());
  h.shutdown();
  sleep(500);
  assertEquals(1,s.getCluster().getMembers().size());
  final CountDownLatch latch=new CountDownLatch(1);
  new Thread(new Runnable(){
    public void run(){
      maps.size();
      assertNull(maps.get("String_Node_Str"));
      maps.put("String_Node_Str","String_Node_Str");
      latch.countDown();
    }
  }
).start();
  h=Hazelcast.newHazelcastInstance(configNormal);
  latch.await();
  assertEquals(2,h.getCluster().getMembers().size());
  assertEquals(2,s.getCluster().getMembers().size());
  assertFalse(h.getCluster().getLocalMember().isSuperClient());
  assertTrue(s.getCluster().getLocalMember().isSuperClient());
  map=h.getMap("String_Node_Str");
  assertEquals("String_Node_Str",map.put("String_Node_Str","String_Node_Str"));
  assertEquals("String_Node_Str",map.get("String_Node_Str"));
  assertEquals(1,map.size());
  assertEquals(1,maps.size());
}

Fixed version (ground truth):
@Test(timeout=60000) public void testSuperClientRestart() throws Exception {
  Config configNormal=new Config();
  Config configSuper=new Config();
  configSuper.setLiteMember(true);
  HazelcastInstance h=Hazelcast.newHazelcastInstance(configNormal);
  HazelcastInstance s=Hazelcast.newHazelcastInstance(configSuper);
  assertEquals(2,h.getCluster().getMembers().size());
  assertEquals(2,s.getCluster().getMembers().size());
  assertFalse(h.getCluster().getLocalMember().isSuperClient());
  assertTrue(s.getCluster().getLocalMember().isSuperClient());
  IMap map=h.getMap("String_Node_Str");
  final IMap maps=s.getMap("String_Node_Str");
  assertNull(map.put("String_Node_Str","String_Node_Str"));
  assertEquals("String_Node_Str",map.get("String_Node_Str"));
  assertEquals("String_Node_Str",maps.get("String_Node_Str"));
  assertEquals(1,map.size());
  assertEquals(1,maps.size());
  h.shutdown();
  sleep(500);
  assertEquals(1,s.getCluster().getMembers().size());
  final CountDownLatch latch=new CountDownLatch(1);
  new Thread(new Runnable(){
    public void run(){
      maps.size();
      assertNull(maps.get("String_Node_Str"));
      maps.put("String_Node_Str","String_Node_Str");
      latch.countDown();
    }
  }
).start();
  h=Hazelcast.newHazelcastInstance(configNormal);
  latch.await();
  assertEquals(2,h.getCluster().getMembers().size());
  assertEquals(2,s.getCluster().getMembers().size());
  assertFalse(h.getCluster().getLocalMember().isSuperClient());
  assertTrue(s.getCluster().getLocalMember().isSuperClient());
  map=h.getMap("String_Node_Str");
  assertEquals("String_Node_Str",map.put("String_Node_Str","String_Node_Str"));
  assertEquals("String_Node_Str",map.get("String_Node_Str"));
  assertEquals(1,map.size());
  assertEquals(1,maps.size());
}