MatrixView extends AbstractMatrix { @Override public int[] getNumNondefaultElements() { return cardinality; } 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 testSize() { int[] c = test.getNumNondefaultElements(); assertEquals("row size", values.length - 2, c[ROW]); assertEquals("col size", values[0].length - 1, c[COL]); }