@Test
public void testReset() throws Exception {

    FileRecordReader rr = new FileRecordReader();
    rr.initialize(new FileSplit(new ClassPathResource("iris.dat").getFile()));
    int nResets = 5;
    for (int i = 0; i < nResets; i++) {
        int lineCount = 0;
        while (rr.hasNext()) {
            List<Writable> line = rr.next();
            assertEquals(1, line.size());
            lineCount++;
        }
        assertFalse(rr.hasNext());
        assertEquals(1, lineCount);
        rr.reset();
    }
}