KeyTree { @Override public String toString() { return this.root.toString(); } 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 testToString() { 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 String expected = "{indent=0, name='', comment='null', side='null', children=[{indent=0, name='nodekey', comment='null', side='null', children=[]}]}"; MatcherAssert.assertThat( "toString returns a wrong value.", tree.toString(), new IsEqual<>(expected) ); }