KeyTree { public KeyTree.Node get(final String path) { return this.nodes.get(path); } KeyTree(final YamlConfigurationOptions options); KeyTree.Node add(final String path); KeyTree.Node findParent(final int indent); KeyTree.Node get(final String path); Set<String> keys(); Set<Map.Entry<String, KeyTree.Node>> entries(); @Override String toString();  }
@Test void get() { final YamlConfiguration configuration = new YamlConfiguration(); final YamlConfigurationOptions options = new TestYamlConfigurationOptions(configuration); final KeyTree tree = new KeyTree(options); final String nodekey = "nodekey"; tree.add(nodekey); final KeyTree.Node node = tree.get(nodekey); MatcherAssert.assertThat( "The node has a root!", node.getIndentation(), new IsEqual<>(0) ); MatcherAssert.assertThat( "The node's name is not correct!", node.getName(), new IsEqual<>(nodekey) ); MatcherAssert.assertThat( "There is a comment!", node.getComment(), new IsNull<>() ); MatcherAssert.assertThat( "There is a side comment!", node.getSideComment(), new IsNull<>() ); }