ConcurrentTree extends ConcurrentTreeNode<K, V> { public V get(final K[] path) { ConcurrentTreeNode<K, V> node = this; for (final K part : path) { node = node.getChild(part); if (node == null) { return null; } } return node.getValue(); }  synchronized void add(final K[] path, final V value); synchronized V remove(final K[] path); V get(final K[] path); List<V> getMatches(final K[] path); @Override String toString();  }
@Test public void testGet() { ConcurrentTree<String, String> tree = setupTree(); assertNull(tree.get(delimiter.split("a/b/c/d/e/f/g"))); assertEquals(tree.get(delimiter.split("a/b/c/d/e/f")), "a/b/c/d/e/f"); assertNull(tree.get(delimiter.split("a/b/c/d/e"))); assertEquals(tree.get(delimiter.split("a/b/c/d")), "a/b/c/d"); assertNull(tree.get(delimiter.split("a/b/c"))); assertEquals(tree.get(delimiter.split("a/b")), "a/b"); assertNull(tree.get(delimiter.split("a"))); assertNull(tree.get(delimiter.split(""))); assertNull(tree.get(delimiter.split("/a/b"))); assertNull(tree.get(delimiter.split("a assertNull(tree.get(delimiter.split("a/b/ "))); }