UniformSnapshot extends Snapshot { @Override public long getMin() { if (values.length == 0) { return 0; } return values[0]; } UniformSnapshot(Collection<Long> values);  UniformSnapshot(long[] values); @Override double getValue(double quantile); @Override int size(); @Override long[] getValues(); @Override long getMax(); @Override long getMin(); @Override double getMean(); @Override double getStdDev(); @Override void dump(OutputStream output);  }
@Test public void calculatesTheMinimumValue() { assertThat(snapshot.getMin()) .isEqualTo(1); }
@Test public void calculatesAMinOfZeroForAnEmptySnapshot() { final Snapshot emptySnapshot = new UniformSnapshot(new long[]{}); assertThat(emptySnapshot.getMin()) .isZero(); }