static String headerLine(CSVFormat csvFormat) {
    return String.join(String.valueOf(csvFormat.getDelimiter()), csvFormat.getHeader());
  }
@Test
  public void givenInvalidCsvRecord_throws() {
    CSVFormat csvFormat = csvFormat().withQuote('"');
    PCollection<String> input =
        pipeline.apply(Create.of(headerLine(csvFormat), "a,\"1,1.1", "b,2,2.2", "c,3,3.3"));
    CsvIOStringToCsvRecord underTest = new CsvIOStringToCsvRecord(csvFormat);
    CsvIOParseResult<List<String>> result = input.apply(underTest);
    PAssert.thatSingleton(result.getErrors().apply(Count.globally())).isEqualTo(1L);
    pipeline.run();
  }