@Test
public void shouldStreamCheckDetailWithReader() throws Exception {

    try (X9InputStreamRecordReader reader1 = X9InputStreamRecordReaderTest.buildReaderFromFile()) {
        RecordCountRecordFilter filter = new RecordCountRecordFilter();
        reader1.addFilter(filter);
        X9InputStreamCheckDetailReader reader = new X9InputStreamCheckDetailReader(reader1);
        final int[] recordsFound = {0};
        reader.stream().forEach(graph -> {
            X937CheckDetailRecord detailRecord = graph.checkDetailRecord();
          log.info(detailRecord.toString());
            recordsFound[0]++;
        });
        assertEquals(recordsFound[0], filter.getRecordCounters()[25]);
    }
}