@Test
public void testPlus() {

    Vector mean = VectorUtils.of(1, 0);
    CovarianceMatricesAggregator agg1 = new CovarianceMatricesAggregator(mean, identity(2), 1);
    CovarianceMatricesAggregator agg2 = new CovarianceMatricesAggregator(mean, identity(2).times(2), 3);
    CovarianceMatricesAggregator res = agg1.plus(agg2);
    assertArrayEquals(mean.asArray(), res.mean().asArray(), 1e-4);
    assertArrayEquals(identity(2).times(3).getStorage().data(), res.weightedSum().getStorage().data(), 1e-4);
    assertEquals(4, res.rowCount());
}