### Question:
VerticalRecordPrinter implements OutputPrinter { @Override public void finish() throws IOException { if (rowCount == 0) { writer.append("(no rows)\n"); } writer.flush(); } VerticalRecordPrinter(List<String> fieldNames, Writer writer); @Override void finish(); @Override void printRows(List<List<?>> rows, boolean complete);  }### Answer:
@Test public void testVerticalPrintingNoRows() throws Exception { StringWriter writer = new StringWriter(); List<String> fieldNames = ImmutableList.of("none"); OutputPrinter printer = new VerticalRecordPrinter(fieldNames, writer); printer.finish(); assertEquals(writer.getBuffer().toString(), "(no rows)\n"); }