### Question:
DoubleMatrix implements Matrix, Serializable, ImmutableBean { public static DoubleMatrix copyOf(double[][] array) { int rows = array.length; if (rows == 0 || array[0].length == 0) { return EMPTY; } int columns = array[0].length; return new DoubleMatrix(deepClone(array, rows, columns), rows, columns); } DoubleMatrix(double[][] data, int rows, int columns); @ImmutableConstructor private  DoubleMatrix(double[][] array); static DoubleMatrix of(); static DoubleMatrix of(int rows, int columns, double... values); static DoubleMatrix of(int rows, int columns, IntIntToDoubleFunction valueFunction); static DoubleMatrix ofArrays(int rows, int columns, IntFunction<double[]> valuesFunction); static DoubleMatrix ofArrayObjects(int rows, int columns, IntFunction<DoubleArray> valuesFunction); static DoubleMatrix ofUnsafe(double[][] array); static DoubleMatrix copyOf(double[][] array); static DoubleMatrix filled(int rows, int columns); static DoubleMatrix filled(int rows, int columns, double value); static DoubleMatrix identity(int size); static DoubleMatrix diagonal(DoubleArray array); @Override int dimensions(); @Override int size(); int rowCount(); int columnCount(); boolean isSquare(); boolean isEmpty(); double get(int row, int column); DoubleArray row(int row); double[] rowArray(int row); DoubleArray column(int column); double[] columnArray(int column); double[][] toArray(); double[][] toArrayUnsafe(); void forEach(IntIntDoubleConsumer action); DoubleMatrix with(int row, int column, double newValue); DoubleMatrix multipliedBy(double factor); DoubleMatrix map(DoubleUnaryOperator operator); DoubleMatrix mapWithIndex(IntIntDoubleToDoubleFunction function); DoubleMatrix plus(DoubleMatrix other); DoubleMatrix minus(DoubleMatrix other); DoubleMatrix combine(DoubleMatrix other, DoubleBinaryOperator operator); double total(); double reduce(double identity, DoubleBinaryOperator operator); DoubleMatrix transpose(); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString(); static DoubleMatrix.Meta meta(); @Override DoubleMatrix.Meta metaBean(); static final DoubleMatrix EMPTY; }### Answer:
@Test public void test_copyOf_array() { double[][] base = {{1d, 2d}, {3d, 4d}}; DoubleMatrix test = DoubleMatrix.copyOf(base); assertMatrix(test, 1d, 2d, 3d, 4d); base[0][0] = 7d; assertMatrix(test, 1d, 2d, 3d, 4d); assertMatrix(DoubleMatrix.copyOf(new double[0][0])); assertMatrix(DoubleMatrix.copyOf(new double[0][2])); assertMatrix(DoubleMatrix.copyOf(new double[2][0])); }