public synchronized void clear() {
    this.buckets = new long[bucketType.getNumBuckets()];
    this.numBoundedBucketRecords = 0;
    this.numTopRecords = 0;
    this.topRecordsSum = 0;
    this.numBottomRecords = 0;
    this.bottomRecordsSum = 0;
    this.mean = 0;
    this.sumOfSquaredDeviations = 0;
  }
@Test
  public void testClear() {
    HistogramData histogramData = HistogramData.linear(0, 0.2, 50);
    histogramData.record(-1, 1, 2, 3);
    assertThat(histogramData.getTotalCount(), equalTo(4L));
    assertThat(histogramData.getCount(5), equalTo(1L));
    histogramData.clear();
    assertThat(histogramData.getTotalCount(), equalTo(0L));
    assertThat(histogramData.getCount(5), equalTo(0L));
  }