public class RegistryTestCase {
@Test
public void test1() throws UnknownHostException {
HazelcastInstance h1 = create("54327", 9001);
IMap<Object, Object> h1map = h1.getMap("mymap");
h1map.put("key1", "bla1");
Assert.assertEquals("bla1", h1map.get("key1"));
HazelcastInstance h2 = create("false", 9002, 9001);
IMap<Object, Object> h2map = h2.getMap("mymap");
Assert.assertEquals("bla1", h2map.get("key1"));
HazelcastInstance h3 = create("false", 9003, 9002);
IMap<Object, Object> h3map = h3.getMap("mymap");
Assert.assertEquals("bla1", h3map.get("key1"));
h3map.put("k3", "v3");
h2map.put("k2", "v2");
Assert.assertEquals("v2", h1map.get("k2"));
Assert.assertEquals("v3", h1map.get("k3"));
Assert.assertEquals("v2", h2map.get("k2"));
Assert.assertEquals("v3", h2map.get("k3"));
Assert.assertEquals("v2", h3map.get("k2"));
Assert.assertEquals("v3", h3map.get("k3"));
HazelcastInstance h4 = create("54328", 9004, 9001);
IMap<Object, Object> h4map = h4.getMap("mymap");
// Assert.assertNull(h4map.get("k2"));
// Assert.assertNull(h4map.get("k3"));
Assert.assertEquals("v2", h4map.get("k2"));
Assert.assertEquals("v3", h4map.get("k3"));
// HazelcastInstance h5 = create("false", 9005, 9003, 9004);
HazelcastInstance h5 = create("54328", 9005);
// Assert.assertEquals("v2", h4map.get("k2"));
// Assert.assertEquals("v3", h4map.get("k3"));
IMap<Object, Object> h5map = h5.getMap("mymap");
Assert.assertEquals("v2", h5map.get("k2"));
Assert.assertEquals("v3", h5map.get("k3"));
h1.shutdown();