### Question:
Scalar extends Tensor<Scalar> { @Override public Scalar add(Scalar b) { return new Scalar(value() + b.value()); } Scalar(double value); @Override Scalar zeros(); @Override Scalar copy(); @Override Scalar add(Scalar b);  }### Answer:
@Test void addsScalar() { var scalar = new Scalar(5D); var scalarToAdd = new Scalar(2D); Scalar sum = scalar.add(scalarToAdd); assertNotSame(scalar, sum); assertNotSame(scalarToAdd, sum); assertArrayEquals(new double[] {7D}, sum.data); }