@Override
    public void update(double sampleValue) {
        double oldMean = onlineMeanCalculator.getValue();

        onlineMeanCalculator.update(sampleValue);
        numSamples++;

        double newMean = onlineMeanCalculator.getValue();

        m2 += (sampleValue - oldMean) * (sampleValue - newMean);
    }
@Test
    void insufficientSamples() {
        WelfordVarianceCalculator calculator = new WelfordVarianceCalculator();
        calculator.update(1.23d);
        assertThrows(NotEnoughSampleException.class, calculator::getValue);
    }