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

        double sum = 0;
        for (long value : values) {
            sum += value;
        }
        return sum / values.length;
    }
@Test
    public void calculatesAMeanOfZeroForAnEmptySnapshot() {
        final Snapshot emptySnapshot = new UniformSnapshot(new long[]{});

        assertThat(emptySnapshot.getMean())
                .isZero();
    }