@Test public void testPrettyPrint_ToAppendable() throws Exception { Node root = getHandBuiltTestTree(); String expected1 = "○\n" + "└── ○ B (1)\n" + " └── ○ A (2)\n" + " └── ○ N (3)\n" + " ├── ○ AN (5)\n" + " │ └── ○ A (6)\n" + " └── ○ DANA (4)\n"; StringBuilder appendable = new StringBuilder(); PrettyPrinter.prettyPrint(wrapNodeForPrinting(root), appendable); Assert.assertEquals(expected1, appendable.toString()); }
public static String prettyPrint(PrettyPrintable tree) { StringBuilder sb = new StringBuilder(); prettyPrint(tree.getNode(), sb, "", true, true); return sb.toString(); }
PrettyPrinter { public static String prettyPrint(PrettyPrintable tree) { StringBuilder sb = new StringBuilder(); prettyPrint(tree.getNode(), sb, "", true, true); return sb.toString(); } }
PrettyPrinter { public static String prettyPrint(PrettyPrintable tree) { StringBuilder sb = new StringBuilder(); prettyPrint(tree.getNode(), sb, "", true, true); return sb.toString(); } PrettyPrinter(); }
PrettyPrinter { public static String prettyPrint(PrettyPrintable tree) { StringBuilder sb = new StringBuilder(); prettyPrint(tree.getNode(), sb, "", true, true); return sb.toString(); } PrettyPrinter(); static String prettyPrint(PrettyPrintable tree); static void prettyPrint(PrettyPrintable tree, Appendable appendable); }
PrettyPrinter { public static String prettyPrint(PrettyPrintable tree) { StringBuilder sb = new StringBuilder(); prettyPrint(tree.getNode(), sb, "", true, true); return sb.toString(); } PrettyPrinter(); static String prettyPrint(PrettyPrintable tree); static void prettyPrint(PrettyPrintable tree, Appendable appendable);  }