MatrixMarketReader implements AutoCloseable { public Stream<Triple<Integer, Integer, Double>> stream() { return lines; } MatrixMarketReader(Reader reader); int getRows(); int getColumns(); Stream<Triple<Integer, Integer, Double>> stream(); @Override void close();  }
@Test public void getMatrixElements() { assertThat(subject.stream().collect(Collectors.toList())).containsExactlyElementsOf(RESULTS); }
@Test public void emptyMatrixProducesEmptyStream() throws IOException { subject = new MatrixMarketReader( new InputStreamReader( MatrixMarketReaderTest.class.getResourceAsStream("empty_matrix.mtx"))); assertThat(subject.stream().collect(Collectors.toList())).hasSize(0); }