### Question:
Dumpable implements Loggeable { public void dump(PrintStream p, String indent) { p.println (indent + "<" + name + ">"); p.print (ISOUtil.hexdump (payload)); p.println (indent + "</" + name + ">"); } Dumpable(String name, byte[] payload); void dump(PrintStream p, String indent);  }### Answer:
@Test public void testDump() { ByteArrayOutputStream baos = new ByteArrayOutputStream(); PrintStream p = new PrintStream(baos); dumpable.dump(p, ":-o"); String lineSep = System.getProperty ("line.separator"); String expected = ":-o<testingDumpable>" + lineSep + "0000 39 38 37 36 35 34 33 32 31 987654321" + lineSep + ":-o</testingDumpable>" + lineSep; assertThat(baos.toString(), is(expected)); }