@Test
public void testGracefulShutdown2() throws Exception {
Config config = new Config();
config.getMapConfig(MAP_NAME).setBackupCount(2);
TestHazelcastInstanceFactory f = createHazelcastInstanceFactory(8);
final HazelcastInstance hz = f.newHazelcastInstance(config);
final IMap<Integer, Integer> map = hz.getMap(MAP_NAME);
final int size = 50000;
for (int i = 0; i < size; i++) {
map.put(i, i);
}
final HazelcastInstance hz2 = f.newHazelcastInstance(config);
final IMap<Integer, Integer> map2 = hz2.getMap(MAP_NAME);
checkSizeEventually(size, map2);
final HazelcastInstance hz3 = f.newHazelcastInstance(config);
final IMap<Integer, Integer> map3 = hz3.getMap(MAP_NAME);
final HazelcastInstance hz4 = f.newHazelcastInstance(config);
final IMap<Integer, Integer> map4 = hz4.getMap(MAP_NAME);
checkSizeEventually(size, map3);
checkSizeEventually(size, map4);
final HazelcastInstance hz5 = f.newHazelcastInstance(config);
final IMap<Integer, Integer> map5 = hz5.getMap(MAP_NAME);
final HazelcastInstance hz6 = f.newHazelcastInstance(config);
final IMap<Integer, Integer> map6 = hz6.getMap(MAP_NAME);
final HazelcastInstance hz7 = f.newHazelcastInstance(config);
final IMap<Integer, Integer> map7 = hz7.getMap(MAP_NAME);
final HazelcastInstance hz8 = f.newHazelcastInstance(config);
final IMap<Integer, Integer> map8 = hz8.getMap(MAP_NAME);
checkSizeEventually(size, map5);
checkSizeEventually(size, map6);
checkSizeEventually(size, map7);