DepTreeNode implements Cloneable, Serializable { @Override public String toString() { StringBuffer sb = new StringBuffer(); if (defineDependencies != null || requireDependencies != null) { sb.append(getFullPathName()).append(" = "); if (defineDependencies != null) { sb.append("define:["); int count = 0; for (String str : defineDependencies) { sb.append(count++ == 0 ? "" : ", ").append(str); } sb.append("]"); } if (requireDependencies != null) { sb.append(requireDependencies != null ? ", " : ""); sb.append("require:["); int count = 0; for (String str : requireDependencies) { sb.append(count++ == 0 ? "" : ", ").append(str); } sb.append("]"); } sb.append('\n'); } return sb.toString(); } DepTreeNode(String name, URI uri); String getName(); long lastModified(); long lastModifiedDep(); long lastModifiedDepTree(); DepTreeNode getParent(); DepTreeNode getRoot(); String[] getDefineDepArray(); String[] getRequireDepArray(); String[] getDependentFeatures(); String getParentPath(); String getFullPathName(); void add(DepTreeNode child); void overlay(DepTreeNode node); void addAll(Collection<DepTreeNode> children); DepTreeNode createOrGet(String path, URI uri); DepTreeNode getDescendent(String path); void remove(DepTreeNode child); void removeAll(); Map<String, DepTreeNode> getChildren(); DepTreeNode getChild(String name); void prune(); void setDependencies(String[] defineDependencies, String[] requireDependencies, String[] dependentFeatures, long lastModifiedFile, long lastModifiedDep); @Override String toString(); String toStringTree(); @Override DepTreeNode clone(); IConfig getConfig();  }
@Test public void testToString() { DepTreeNode root = new DepTreeNode("root", null); root.setDependencies(new String[] {"a", "b"}, new String[0], new String[0], 0L, 1L); root.createOrGet("child", null); String str = root.toString(); assertEquals(str, "root = define:[a, b], require:[]\n"); }