ConfigNode { public void sort() { Collections.sort(nodeOrder); } 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 childNodesAreSorted() { List<String> nodeOrder = new ArrayList<>(testTree.nodeOrder); testTree.sort(); assertNotEquals(nodeOrder, testTree.nodeOrder); Collections.sort(nodeOrder); assertEquals(nodeOrder, testTree.nodeOrder); }