@Override
  public MetricRegistry create(MetricRegistryInfo info) {
    return registries.put(info, () -> factory.create(info));
  }
Implementation of MetricRegistries that does ref-counting.
hbase-metrics/src/main/java/org/apache/hadoop/hbase/metrics/impl/MetricRegistriesImpl.java