/** Tests recording of enumerated histograms. */
  @SmallTest
  public void testRecordEnumeratedHistogram() {
    String histogram = "HelloWorld.EnumeratedMetric";
    HistogramDelta zeroCount = new HistogramDelta(histogram, 0);
    HistogramDelta oneCount = new HistogramDelta(histogram, 1);
    HistogramDelta twoCount = new HistogramDelta(histogram, 2);
    final int boundary = 3;

    assertEquals(0, zeroCount.getDelta());
    assertEquals(0, oneCount.getDelta());
    assertEquals(0, twoCount.getDelta());

    RecordHistogram.recordEnumeratedHistogram(histogram, 0, boundary);
    assertEquals(1, zeroCount.getDelta());
    assertEquals(0, oneCount.getDelta());
    assertEquals(0, twoCount.getDelta());

    RecordHistogram.recordEnumeratedHistogram(histogram, 0, boundary);
    assertEquals(2, zeroCount.getDelta());
    assertEquals(0, oneCount.getDelta());
    assertEquals(0, twoCount.getDelta());

    RecordHistogram.recordEnumeratedHistogram(histogram, 2, boundary);
    assertEquals(2, zeroCount.getDelta());
    assertEquals(0, oneCount.getDelta());
    assertEquals(1, twoCount.getDelta());
  }