in src/main/java/org/apache/commons/csv/CSVFormat.java [1481:1492]
public String format(final Object... values) {
final StringWriter out = new StringWriter();
try (CSVPrinter csvPrinter = new CSVPrinter(out, this)) {
csvPrinter.printRecord(values);
final String res = out.toString();
final int len = recordSeparator != null ? res.length() - recordSeparator.length() : res.length();
return res.substring(0, len);
} catch (final IOException e) {
// should not happen because a StringWriter does not do IO.
throw new IllegalStateException(e);
}
}