CSVPrinter implements Flushable, Closeable { public void close() throws IOException { if (out instanceof Closeable) { ((Closeable) out).close(); } } CSVPrinter(final Appendable out, final CSVFormat format); void println(); void flush(); void printRecord(final Object... values); void printRecord(final Iterable<?> values); void printComment(final String comment); void print(final Object value); void printRecords(final Object[] values); void printRecords(final Iterable<?> values); void printRecords(final ResultSet resultSet); void close();  }
@Test(expected = IllegalArgumentException.class) public void testInvalidFormat() throws Exception { final CSVFormat invalidFormat = CSVFormat.DEFAULT.withDelimiter(CR); new CSVPrinter(new StringWriter(), invalidFormat).close(); }