private void testSampler(final double[][] covMatrix, int samples, double epsilon) {
CorrelatedRandomVectorGenerator sampler = createSampler(covMatrix);
StorelessCovariance cov = new StorelessCovariance(covMatrix.length);
for (int i = 0; i < samples; ++i) {
cov.increment(sampler.nextVector());
}
double[][] sampleCov = cov.getData();
for (int r = 0; r < covMatrix.length; ++r) {
TestUtils.assertEquals(covMatrix[r], sampleCov[r], epsilon);