CsvLineParser { public List<String> parse(final CharSequence line) { return this.lineParser.parse( line.toString() ); } CsvLineParser(); List<String> parse(final CharSequence line);  }
@Test public void testSimpleLineParse() { final CsvLineParser parser = new CsvLineParser(); final String s = "a,b,c"; final List<String> list = parser.parse( s ); assertEquals( 3, list.size() ); assertEquals( "a", list.get( 0 ) ); assertEquals( "b", list.get( 1 ) ); assertEquals( "c", list.get( 2 ) ); }
@Test public void testLineParse() { final CsvLineParser parser = new CsvLineParser(); final String s = "a,\"b\",c"; final List<String> list = parser.parse( s ); assertEquals( 3, list.size() ); assertEquals( "a", list.get( 0 ) ); assertEquals( "b", list.get( 1 ) ); assertEquals( "c", list.get( 2 ) ); }
@Test public void testDoubleQuotes() { final CsvLineParser parser = new CsvLineParser(); final String s = "a,\"\"\"b\"\"\",c"; final List<String> list = parser.parse( s ); assertEquals( 3, list.size() ); assertEquals( "a", list.get( 0 ) ); assertEquals( "\"b\"", list.get( 1 ) ); assertEquals( "c", list.get( 2 ) ); }