@Test(expected = IllegalArgumentException.class)
public void testInvalidFormat() throws Exception {

    final CSVFormat invalidFormat = CSVFormat.DEFAULT.withDelimiter(CR);
    new CSVPrinter(new StringWriter(), invalidFormat).close();
}