X9InputStreamReturnReader implements Iterable<X937ReturnGraph>, Closeable { @Override public void close() throws IOException { reader.close(); } X9InputStreamReturnReader(InputStream inputStream);  X9InputStreamReturnReader(X9InputStreamRecordReader reader);  X9InputStreamReturnReader(InputStream inputStream, boolean skipInvalidRecords); X937ReturnGraph readNextReturn(); @Override void close(); Stream<X937ReturnGraph> stream(); @Override Iterator<X937ReturnGraph> iterator();  }
@Test public void shouldIterateReturn() throws Exception { X9InputStreamReturnReader reader = buildReaderFromFile(); for (X937ReturnGraph graph : reader) { X937ReturnRecord detailRecord = graph.returnRecord(); log.info(detailRecord.toString()); } reader.close(); }