public void testOverflow() { ShortHistogram histogram = new ShortHistogram(highestTrackableValue, 2); histogram.recordValue(testValueLevel); histogram.recordValue(testValueLevel * 10); Assert.assertFalse(histogram.hasOverflowed()); // This should overflow a ShortHistogram: histogram.recordValueWithExpectedInterval(histogram.getHighestTrackableValue() - 1, 500); Assert.assertTrue(histogram.hasOverflowed()); Console.WriteLine("Histogram percentile output should show overflow:"); histogram.outputPercentileDistribution(Console.Out, 5, 100.0); Console.WriteLine("\nHistogram percentile output should be in CSV format and show overflow:"); histogram.outputPercentileDistribution(Console.Out, 5, 100.0, true); Console.WriteLine(""); }