ConfigNode { protected int getNodeDepth() { return parent != null ? parent.getNodeDepth() + 1 : -1; } ConfigNode(String key, ConfigNode parent, String value); Optional<ConfigNode> getNode(String path); boolean contains(String path); ConfigNode addNode(String path); boolean removeNode(String path); void remove(); boolean moveChild(String oldPath, String newPath); String getKey(boolean deep); void sort(); void reorder(List<String> newOrder); void save(); void set(String path, T value); void set(T value); List<String> getComment(); void setComment(List<String> comment); List<String> getStringList(); Integer getInteger(); Long getLong(); String getString(); boolean getBoolean(); List<String> getStringList(String path); Map<String, String> getStringMap(boolean fullKeys); Integer getInteger(String path); Long getLong(String path); String getString(String path); boolean getBoolean(String path); void copyMissing(ConfigNode from); void copyAll(ConfigNode from); ConfigNode getParent(); boolean isLeafNode(); Collection<ConfigNode> getChildren(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }
@Test void rootNodeReturnsDepthZero() { assertEquals(-1, testTree.getNodeDepth()); }
@Test void depthOneIsReturnedCorrectly() { assertEquals(0, testTree.childNodes.get(SIMPLE_STRING_NODE).getNodeDepth()); }
@Test void depthTwoIsReturnedCorrectly() { assertEquals(1, testTree.childNodes.get(FIRST_LEVEL).childNodes.get(SECOND_LEVEL).getNodeDepth()); }