code: public void addListener(MetricRegistryListener listener) {
          listeners.add(listener);
  
          for (Map.Entry<MetricName, Metric> entry : metrics.entrySet()) {
              notifyListenerOfAddedMetric(listener, entry.getValue(), entry.getKey());
          }
      }
docs: Adds a {@link MetricRegistryListener} to a collection of listeners that will be notified on
  metric creation.  Listeners will be notified in the order in which they are added.
  
  <b>N.B.:</b> The listener will be notified of all existing metrics when it first registers.
  
  @param listener the listener that will be notified