@Test
public void testForEach() throws Exception {

    final List<CSVRecord> records = new ArrayList<CSVRecord>();
    final Reader in = new StringReader("a,b,c\n1,2,3\nx,y,z");
    for (final CSVRecord record : CSVFormat.DEFAULT.parse(in)) {
        records.add(record);
    }
    assertEquals(3, records.size());
    assertArrayEquals(new String[]{"a", "b", "c"}, records.get(0).values());
    assertArrayEquals(new String[]{"1", "2", "3"}, records.get(1).values());
    assertArrayEquals(new String[]{"x", "y", "z"}, records.get(2).values());
}