### Question:
CsvWriter implements Closeable, Flushable { public void writeAll(List<String[]> allLines, boolean applyQuotesToAll) { for (String[] line : allLines) { writeNext(line, applyQuotesToAll); } } CsvWriter(Writer writer);  CsvWriter(Writer writer, char separator);  CsvWriter(Writer writer, char separator, char quotechar);  CsvWriter(Writer writer, char separator, char quotechar, char escapechar);  CsvWriter(Writer writer, char separator, char quotechar, String lineEnd);  CsvWriter(Writer writer, char separator, char quotechar, char escapechar, String lineEnd); void writeAll(List<String[]> allLines, boolean applyQuotesToAll); void writeAll(List<String[]> allLines); void writeAll(java.sql.ResultSet rs, boolean includeColumnNames); void writeAll(java.sql.ResultSet rs, boolean includeColumnNames, boolean trim); void writeNext(String[] nextLine, boolean applyQuotesToAll); void writeNext(String[] nextLine); void flush(); void close(); boolean checkError(); void setResultService(ResultSetHelper resultService); void flushQuietly(); static final int INITIAL_STRING_SIZE; static final char DEFAULT_ESCAPE_CHARACTER; static final char DEFAULT_SEPARATOR; static final char DEFAULT_QUOTE_CHARACTER; static final char NO_QUOTE_CHARACTER; static final char NO_ESCAPE_CHARACTER; static final String DEFAULT_LINE_END; }### Answer:
@Test public void testWriteAll() throws IOException { List<String[]> allElements = new ArrayList<String[]>(); String[] line1 = "Name#Phone#Email".split("#"); String[] line2 = "Glen#1234#glen@abcd.com".split("#"); String[] line3 = "John#5678#john@efgh.com".split("#"); allElements.add(line1); allElements.add(line2); allElements.add(line3); StringWriter sw = new StringWriter(); CsvWriter csvw = new CsvWriter(sw); csvw.writeAll(allElements); String result = sw.toString(); String[] lines = result.split("\n"); assertEquals(3, lines.length); csvw.close(); }