ParseTree { @Override public String toString() { StringBuilder builder = new StringBuilder(name).append(": "); if (children.isEmpty()){ builder.append(value); } else { builder.append("{\n"); Strings.join(builder, ",\n", children); builder.append("\n}"); } return builder.toString(); } ParseTree(
      String name,
      int beginIndex,
      int endIndex,
      Object value,
      List<ParseTree> children); String getName(); int getBeginIndex(); int getEndIndex(); Object getValue(); List<ParseTree> getChildren(); @Override String toString();  }
@Test public void noChildren() { Assert.assertEquals("foo: 123", tree("foo", 123).toString()); }
@Test public void oneChild() { Assert.assertEquals("foo: {\nbar: x\n}", tree("foo", 123, tree("bar", "x")).toString()); }
@Test public void oneChildren() { Assert.assertEquals("foo: {\nbar: x,\nbaz: y\n}", tree("foo", 123, tree("bar", "x"), tree("baz", "y")).toString()); }