@Test(expected = NoSuchElementException.class)
public void testClose() throws Exception {

    final Reader in = new StringReader("# comment\na,b,c\n1,2,3\nx,y,z");
    final CSVParser parser = CSVFormat.DEFAULT.withCommentStart('#').withHeader().parse(in);
    final Iterator<CSVRecord> records = parser.iterator();
    assertTrue(records.hasNext());
    parser.close();
    assertFalse(records.hasNext());
    records.next();
}