@Test
public void testSum() {

    for (int K = 12; K < 120; ++K) {
        DataBlock z = new DataBlock(K);
        z.randomize(0);
        Periodogram p = new Periodogram(z, false);
        DataBlock q = new DataBlock(p.getP());
        assertTrue(Math.abs(q.sum() - K) < 1e-6);
        p = new Periodogram(z, true);
        q = new DataBlock(p.getP());
        assertTrue(Math.abs(q.sum() - K) < 1e-6);
    }
}