public void record(long latencyNano, Consumer<AbstractHistogram> overflownConsumer) {
    recordSafeValue(narrow(latencyNano), overflownConsumer);
  }
@Test
  public void testOverflowRecording()
  {
    LatencyMetric metric = new LatencyMetric();
    for (int j = 0; j < 3; j++)
    {
      GaussianResponseTimeDistribution distribution =
          new GaussianResponseTimeDistribution(0, j * 100, 10, TimeUnit.MILLISECONDS);
      AtomicReference<AbstractHistogram> histogram = new AtomicReference<>();
      //record until overflow
      do
      {
        metric.record(distribution.responseTimeNanos(), h -> histogram.set(h.copy()));
      } while (histogram.get() == null);
      assertTrue(histogram.get().getTotalCount() > Short.MAX_VALUE);
      assertEquals(histogram.get().getMean(), j * 100000000d, 10000000d);
    }
  }