MatrixView extends AbstractMatrix { @Override public Vector getRow(int row) { if (row < 0 || row >= rowSize()) { throw new IndexException(row, rowSize()); } return new VectorView(matrix.getRow(row + offset[ROW]), offset[COL], columnSize()); } private  MatrixView();  MatrixView(Matrix matrix, int[] offset, int[] size); @Override Matrix clone(); @Override double getQuick(int row, int column); @Override Matrix like(); @Override Matrix like(int rows, int columns); @Override void setQuick(int row, int column, double value); @Override int[] getNumNondefaultElements(); @Override Matrix viewPart(int[] offset, int[] size); @Override Matrix assignColumn(int column, Vector other); @Override Matrix assignRow(int row, Vector other); @Override Vector getColumn(int column); @Override Vector getRow(int row);  }
@Test public void testGetRow() { Vector row = test.getRow(1); assertEquals("row size", 2, row.getNumNondefaultElements()); }
@Test(expected = IndexException.class) public void testGetRowIndexUnder() { test.getRow(-1); }
@Test(expected = IndexException.class) public void testGetRowIndexOver() { test.getRow(5); }