@Test(expected = IllegalStateException.class) public void testPrettyPrint_WrapIOException() { Node root = getHandBuiltTestTree(); Appendable appendable = new Appendable() { @Override public Appendable append(CharSequence csq) throws IOException { throw new IOException("Intentional exception"); } @Override public Appendable append(CharSequence csq, int start, int end) throws IOException { throw new IOException("Intentional exception"); } @Override public Appendable append(char c) throws IOException { throw new IOException("Intentional exception"); } }; PrettyPrinter.prettyPrint(wrapNodeForPrinting(root), appendable); }
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);  }