@Test public void testDeletion() throws Exception { getZk().create(ZkPath.append(getRoot(), "map"), null, Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT); getZk().create(ZkPath.append(getRoot(), "map/1"), "2".getBytes(), Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT); final WatchedMap<String> m = new WatchedMap<>(getZk(), ZkPath.append(getRoot(), "map"), new StringElementLoader()); assertEquals(new HashMap<String, String>() {{ put("1", "2"); }}, m); getZk().delete(ZkPath.append(getRoot(), "map/1"), 0); WaitUntil.orDie(() -> Collections.EMPTY_MAP.equals(m)); assertEquals(Collections.EMPTY_MAP, m); } }