### Question:
FileRecordReader extends BaseRecordReader { @Override public void reset() { if (inputSplit == null) throw new UnsupportedOperationException("Cannot reset without first initializing"); try { doInitialize(inputSplit); } catch (Exception e) { throw new RuntimeException("Error during LineRecordReader reset", e); } } FileRecordReader(); @Override void initialize(InputSplit split); @Override void initialize(Configuration conf, InputSplit split); @Override List<Writable> next(); int getCurrentLabel(); int getLabel(URI uri); List<String> getLabels(); void setLabels(List<String> labels); @Override boolean hasNext(); @Override void close(); @Override void setConf(Configuration conf); @Override Configuration getConf(); @Override List<List<Writable>> next(int num); @Override void reset(); @Override boolean resetSupported(); @Override List<Writable> record(URI uri, DataInputStream dataInputStream); @Override Record nextRecord(); @Override Record loadFromMetaData(RecordMetaData recordMetaData); @Override List<Record> loadFromMetaData(List<RecordMetaData> recordMetaDatas);  }### Answer:
@Test public void testReset() throws Exception { FileRecordReader rr = new FileRecordReader(); rr.initialize(new FileSplit(new ClassPathResource("datavec-api/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(); } }