### Question:
DelimitedEscapedBundleEncoder extends AbstractBufferingHttpBundleEncoder { public static DelimitedEscapedBundleEncoder create(String filename, String format) { String delimiter; switch (format) { case "csv2": delimiter = ","; break; case "psv2": delimiter = "|"; break; case "tsv2": delimiter = "\t"; break; default: throw new QueryException("Invalid format \"" + format + "\""); } String suffix = format.substring(0, 3); if (!filename.toLowerCase().endsWith("." + suffix)) { filename = filename.concat("." + suffix); } return new DelimitedEscapedBundleEncoder(filename, delimiter); } DelimitedEscapedBundleEncoder(String filename, String delimiter); static DelimitedEscapedBundleEncoder create(String filename, String format); static String buildRow(Bundle row, String delimiter); static void buildRow(Bundle row, String delimiter, StringBuilder stringBuilder); @Override void appendBundleToString(Bundle row, StringBuilder stringBuilder);  }### Answer:
@Test public void arrayRoundTrip() throws Exception { ValueArray input = ValueFactory.createArray(3); input.add(ValueFactory.create("foo")); input.add(ValueFactory.create("bar")); input.add(ValueFactory.create("baz")); csvEncodedJSONRoundTrip(input); }
@Test public void arrayWithQuotesRoundTrip() throws Exception { ValueArray input = ValueFactory.createArray(3); input.add(ValueFactory.create("foo")); input.add(ValueFactory.create("bar\"bar")); input.add(ValueFactory.create("baz")); csvEncodedJSONRoundTrip(input); }
@Test public void arrayWithEscapeRoundTrip() throws Exception { ValueArray input = ValueFactory.createArray(3); input.add(ValueFactory.create("foo")); input.add(ValueFactory.create("bar\\bar")); input.add(ValueFactory.create("baz")); csvEncodedJSONRoundTrip(input); }
@Test public void arrayWithSeveralEscapedRoundTrip() throws Exception { ValueArray input = ValueFactory.createArray(3); input.add(ValueFactory.create("foo\"hello\"world")); input.add(ValueFactory.create("bar\\bar\"baz\\\\quux")); input.add(ValueFactory.create("baz")); csvEncodedJSONRoundTrip(input); }