### Question:
DoubleMatrix implements Matrix, Serializable, ImmutableBean { public static DoubleMatrix of() { return EMPTY; } 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_of() { assertMatrix(DoubleMatrix.of()); }
@Test public void test_of_values() { assertMatrix(DoubleMatrix.of(0, 0)); assertMatrix(DoubleMatrix.of(1, 0)); assertMatrix(DoubleMatrix.of(0, 1)); assertMatrix(DoubleMatrix.of(2, 3, 1d, 2d, 3d, 4d, 5d, 6d), 1d, 2d, 3d, 4d, 5d, 6d); assertMatrix(DoubleMatrix.of(6, 1, 1d, 2d, 3d, 4d, 5d, 6d), 1d, 2d, 3d, 4d, 5d, 6d); assertThatIllegalArgumentException().isThrownBy(() -> DoubleMatrix.of(1, 2, 1d)); }
@Test public void test_of_intintlambda() { assertMatrix(DoubleMatrix.of(0, 0, (i, j) -> { throw new AssertionError(); })); assertMatrix(DoubleMatrix.of(0, 2, (i, j) -> { throw new AssertionError(); })); assertMatrix(DoubleMatrix.of(2, 0, (i, j) -> { throw new AssertionError(); })); AtomicInteger counter = new AtomicInteger(2); assertMatrix(DoubleMatrix.of(1, 2, (i, j) -> counter.getAndIncrement()), 2d, 3d); assertMatrix(DoubleMatrix.of(2, 2, (i, j) -> (i + 1) * (j + 1)), 1d, 2d, 2d, 4d); }
@Test public void coverage() { coverImmutableBean(DoubleMatrix.EMPTY); coverImmutableBean(DoubleMatrix.of(2, 3, 1d, 2d, 3d, 4d, 5d, 6d)); }