@Test public void calculatesAMaxOfZeroForAnEmptySnapshot() throws Exception { final Snapshot emptySnapshot = new WeightedSnapshot( WeightedArray(new long[]{}, new double[]{}) ); assertThat(emptySnapshot.getMax()) .isZero(); }
@Override public long getMax() { if (values.length == 0) { return 0; } return values[values.length - 1]; }
WeightedSnapshot extends AbstractSnapshot { @Override public long getMax() { if (values.length == 0) { return 0; } return values[values.length - 1]; } }
WeightedSnapshot extends AbstractSnapshot { @Override public long getMax() { if (values.length == 0) { return 0; } return values[values.length - 1]; } WeightedSnapshot(Collection<WeightedSample> values); }
WeightedSnapshot extends AbstractSnapshot { @Override public long getMax() { if (values.length == 0) { return 0; } return values[values.length - 1]; } WeightedSnapshot(Collection<WeightedSample> 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); }
WeightedSnapshot extends AbstractSnapshot { @Override public long getMax() { if (values.length == 0) { return 0; } return values[values.length - 1]; } WeightedSnapshot(Collection<WeightedSample> 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);  }