class HistogramSnapshot extends Snapshot {
    private static final Logger logger = LoggerFactory.getLogger(HistogramSnapshot.class);

    private final Histogram histogram;

    HistogramSnapshot(@Nonnull Histogram histogram) {
        this.histogram = histogram;
    }

    @Override
    public double getValue(double quantile) {
        return histogram.getValueAtPercentile(quantile * 100.0);
    }

    @Override
    public long[] getValues() {<FILL_FUNCTION_BODY>}

    @Override
    public int size() {
        return (int) histogram.getTotalCount();
    }

    @Override
    public long getMax() {
        return histogram.getMaxValue();
    }

    @Override
    public double getMean() {
        return histogram.getMean();
    }

    @Override
    public long getMin() {
        return histogram.getMinValue();
    }

    @Override
    public double getStdDev() {
        return histogram.getStdDeviation();
    }

    @Override
    public void dump(OutputStream output) {
        PrintWriter p = null;
        try {
            p = new PrintWriter(new OutputStreamWriter(output, UTF_8));
            for (HistogramIterationValue value : histogram.recordedValues()) {
                for (int j = 0; j < value.getCountAddedInThisIterationStep(); j++) {
                    p.printf("%d%n", value.getValueIteratedTo());
                }
            }
        } catch (Exception e) {
            if(p != null) p.close();
            logger.error("Exception:", e);
        }
    }
}

        long[] vals = new long[(int) histogram.getTotalCount()];
        int i = 0;

        for (HistogramIterationValue value : histogram.recordedValues()) {
            long val = value.getValueIteratedTo();

            for (int j = 0; j < value.getCountAddedInThisIterationStep(); j++) {
                vals[i] = val;

                i++;
            }
        }

        if (i != vals.length) {
            throw new IllegalStateException(
                "Total count was " + histogram.getTotalCount() + " but iterating values produced " + vals.length);
        }

        return vals;
    
<methods>public non-sealed void <init>() ,public abstract void dump(java.io.OutputStream) ,public double get75thPercentile() ,public double get95thPercentile() ,public double get98thPercentile() ,public double get999thPercentile() ,public double get99thPercentile() ,public abstract long getMax() ,public abstract double getMean() ,public double getMedian() ,public abstract long getMin() ,public abstract double getStdDev() ,public abstract double getValue(double) ,public abstract long[] getValues() ,public abstract int size() <variables>