@Override
    public double getMean() {
        if (values.length == 0) {
            return 0;
        }

        double sum = 0;
        for (int i = 0; i < values.length; i++) {
            sum += values[i] * normWeights[i];
        }
        return sum;
    }
@Test
    public void expectNoOverflowForLowWeights() {
        final Snapshot scatteredSnapshot = new WeightedSnapshot(
                weightedArray(
                        new long[]{1, 2, 3},
                        new double[]{Double.MIN_VALUE, Double.MIN_VALUE, Double.MIN_VALUE}
                )
        );

        assertThat(scatteredSnapshot.getMean())
                .isEqualTo(2);
    }