### Question:
WatchedMap extends AbstractMap<String, T> { public ZooKeeperPlus getZk() { return zk; } WatchedMap(ZooKeeperPlus zk, String basePath, ElementLoader<T> elementLoader);  WatchedMap(ZooKeeperPlus zk, String basePath, ElementLoader<T> elementLoader, CompletionDetector completionDetector); boolean isLoaded(); ZooKeeperPlus getZk(); String getCollectionPath(); Collection<T> values(); Set<Map.Entry<String, T>> entrySet(); Set<String> keySet(); @Override T put(String key, T value); @Override T get(Object key); void addListener(WatchedMapListener<T> listener); void removeListener(WatchedMapListener<T> listener);  }### Answer:
@Test public void testIt() throws Exception { final ZooKeeperPlus zk = getZk(); final String colRoot = ZkPath.append(getRoot(), "collection"); zk.create(colRoot, null, Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT); final ElementLoader<String> elementLoader = (zk1, basePath, relPath) -> { try { return new String(zk1.getData(ZkPath.append(basePath, relPath), false, new Stat())); } catch (Exception e) { throw new RuntimeException(e); } }; final WatchedMap<String> c1 = new WatchedMap<>(zk, colRoot, elementLoader); dumpZk(); WaitUntil.orDie(() -> 0 == c1.size()); assertEquals(0, c1.size()); zk.create(ZkPath.append(colRoot, "first"), "data".getBytes(), Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT); WaitUntil.orDie(() -> 1 == c1.size()); assertEquals(1, c1.size()); }