### Question:
CSVFormat implements Serializable { public String format(final Object... values) { final StringWriter out = new StringWriter(); try { new CSVPrinter(out, this).printRecord(values); return out.toString().trim(); } catch (final IOException e) { throw new IllegalStateException(e); } } CSVFormat(final char delimiter, final Character quoteChar,
            final Quote quotePolicy, final Character commentStart,
            final Character escape, final boolean ignoreSurroundingSpaces,
            final boolean ignoreEmptyLines, final String recordSeparator,
            final String nullString, final String[] header, boolean skipHeaderRecord); static CSVFormat newFormat(final char delimiter); @Override boolean equals(final Object obj); String format(final Object... values); Character getCommentStart(); char getDelimiter(); Character getEscape(); String[] getHeader(); boolean getIgnoreEmptyLines(); boolean getIgnoreSurroundingSpaces(); String getNullString(); Character getQuoteChar(); Quote getQuotePolicy(); String getRecordSeparator(); boolean getSkipHeaderRecord(); @Override int hashCode(); boolean isCommentingEnabled(); boolean isEscaping(); boolean isQuoting(); CSVParser parse(final Reader in); @Override String toString(); CSVFormat withCommentStart(final char commentStart); CSVFormat withCommentStart(final Character commentStart); CSVFormat withDelimiter(final char delimiter); CSVFormat withEscape(final char escape); CSVFormat withEscape(final Character escape); CSVFormat withHeader(final String... header); CSVFormat withIgnoreEmptyLines(final boolean ignoreEmptyLines); CSVFormat withIgnoreSurroundingSpaces(final boolean ignoreSurroundingSpaces); CSVFormat withNullString(final String nullString); CSVFormat withQuoteChar(final char quoteChar); CSVFormat withQuoteChar(final Character quoteChar); CSVFormat withQuotePolicy(final Quote quotePolicy); CSVFormat withRecordSeparator(final char recordSeparator); CSVFormat withRecordSeparator(final String recordSeparator); CSVFormat withSkipHeaderRecord(final boolean skipHeaderRecord); static final CSVFormat DEFAULT; static final CSVFormat RFC4180; static final CSVFormat EXCEL; static final CSVFormat TDF; static final CSVFormat MYSQL; }### Answer:
@Test public void testFormat() { final CSVFormat format = CSVFormat.DEFAULT; assertEquals("", format.format()); assertEquals("a,b,c", format.format("a", "b", "c")); assertEquals("\"x,y\",z", format.format("x,y", "z")); }