Sum implements Matrix<T> { @Override public Vect<T> apply(final Vect<T> input) { final List<Vect<T>> results = new ArrayList<>(this.operands.size()); for (final Matrix<T> oper : this.operands) { results.add(oper.apply(input)); } return new com.aljebra.vector.Sum<T>(results); } Sum(final Iterable<Matrix<T>> operands);  Sum(final Matrix<T> first, final Matrix<T> second); @Override Scalar<T>[] coords(); @Override Scalar<T>[] column(final int index); @Override Scalar<T>[] line(final int index); @Override Vect<T> apply(final Vect<T> input); @Override int columns(); @Override int lines();  }
@Test public void appliesSumTransformation() { final int lines = 3; final int cols = 4; final FixedMatrix<Object> first = new FixedMatrix<>( lines, cols, new Scalars<>(lines * cols) ); final FixedMatrix<Object> second = new FixedMatrix<>( lines, cols, new Scalars<>(lines * cols) ); final Vect<Object> input = new FixedVector<>(new Scalars<>(cols)); MatcherAssert.assertThat( new Sum<Object>(first, second).apply(input), Matchers.equalTo( new com.aljebra.vector.Sum<Object>( first.apply(input), second.apply(input) ) ) ); }