### Question:
CSVMatrixReader implements IMatrixReader { @Override public String[] read() throws IOException, NoSuchElementException { if (!hasNext()) { throw new NoSuchElementException(); } String[] values = reader.getValues(); readRecord(); lineNumber++; int lastNonEmptyCellIdx = ArrayUtils.INDEX_NOT_FOUND; for (int i = values.length - 1; i >= 0; i--) { if (StringUtils.isNotBlank(values[i])) { lastNonEmptyCellIdx = i; break; } } if(lastNonEmptyCellIdx == ArrayUtils.INDEX_NOT_FOUND) { return ArrayUtils.EMPTY_STRING_ARRAY; } if(values.length != lastNonEmptyCellIdx + 1) { values = Arrays.copyOf(values, lastNonEmptyCellIdx + 1); } for (int i=0; i<values.length; i++) { values[i] = values[i].trim(); } return values; } CSVMatrixReader(String fileName);  CSVMatrixReader(String fileName, char delimiter);  CSVMatrixReader(String fileName, String encoding);  CSVMatrixReader(String fileName, char delimiter, String encoding);  CSVMatrixReader(InputStream inputStream);  CSVMatrixReader(InputStream inputStream, String encoding);  CSVMatrixReader(InputStream inputStream, char delimiter);  CSVMatrixReader(InputStream inputStream, char delimiter, String encoding); @Override void close(); @Override SimpleCell[] readCells(); @Override String[] read(); @Override boolean hasNext(); static char determineCSVDelimiter(InputStream is, boolean needClose); static CSVDelimiter determineCSVDelimiter(byte[] bytes, int size);  }### Answer:
@Test public void testRead() { try (CSVMatrixReader e = new CSVMatrixReader("src/test/resources/aml/iomatrix/testcsv.csv")) { StringBuilder sb = new StringBuilder(); while (e.hasNext()) { for (SimpleCell sc : e.readCells()) { sb.append(sc.getValue()); } } if (sb.length() == 0) { fail("File not readed"); } } catch (Exception ex) { fail(ex.getMessage()); } }
@Test public void testReadFromNoMarkSupportInputStream() { try (CSVMatrixReader reader = new CSVMatrixReader( new FileInputStream("src/test/resources/aml/iomatrix/testcsv.csv"))) { String[] expectedCells = { "1494574053", "1000199004", "975277106", "-900841273", "-1205771794", "-436980907","-544962948","-1060190917","1082171287","284431925"}; String[] actualCells = reader.read(); assertArrayEquals("Wrong reading line", expectedCells, actualCells); } catch (Exception ex) { fail(ex.getMessage()); } }