X9InputStreamCheckDetailReader implements Iterable<X937CheckDetailGraph>, Closeable { @Override public void close() throws IOException { reader.close(); } X9InputStreamCheckDetailReader(InputStream inputStream);  X9InputStreamCheckDetailReader(X9InputStreamRecordReader reader);  X9InputStreamCheckDetailReader(InputStream inputStream, boolean skipInvalidRecords); X937CheckDetailGraph readNextCheckDetail(); @Override void close(); Stream<X937CheckDetailGraph> stream(); @Override Iterator<X937CheckDetailGraph> iterator();  }
@Test public void shouldIterateCheckDetail() throws Exception { X9InputStreamCheckDetailReader reader = buildReaderFromFile(); for (X937CheckDetailGraph graph : reader) { X937CheckDetailRecord detailRecord = graph.checkDetailRecord(); log.info(detailRecord.toString()); } reader.close(); }