KeyTree { public Set<String> keys() { return this.nodes.keySet(); } 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 keys() { final YamlConfiguration configuration = new YamlConfiguration(); final YamlConfigurationOptions options = new TestYamlConfigurationOptions(configuration); final KeyTree tree = new KeyTree(options); final String nodekey1 = "nodekey1"; final String nodekey2 = "nodekey2"; final String nodekey3 = "nodekey3"; tree.add(nodekey1); tree.add(nodekey2); tree.add(nodekey3); final Set<String> keys = tree.keys(); MatcherAssert.assertThat( "There are not 3 node in the tree!", keys.size(), new IsEqual<>(3) ); MatcherAssert.assertThat( "The node's key are not correct!", keys, new HasValues<>("nodekey1", "nodekey2", "nodekey3") ); }