### Question:
SlidingWindowHistogram { public synchronized void recordValue(long msValue) { checkArgument(msValue >= 0, "Recorded value must be a positive number."); long currentTime = clock.tickMillis(); purgeOldHistograms(currentTime); int bucket = bucketFromTime(currentTime); window[bucket].recordValue(msValue); lastUpdateTime = currentTime; } private  SlidingWindowHistogram(Builder builder); synchronized void recordValue(long msValue); synchronized double getMean(); synchronized double getValueAtPercentile(double percentile); synchronized double getStdDeviation(); synchronized Histogram copy(); int windowSize(); long timeIntervalMs();  }### Answer:
@Test public void doesNotAcceptNegativeValues() { assertThrows(IllegalArgumentException.class, () -> newHistogram(2, 2).recordValue(-1)); }