SemanticMetricRegistry implements SemanticMetricSet { public void registerAll(final SemanticMetricSet metrics) throws IllegalArgumentException { registerAll(MetricId.EMPTY, metrics); } SemanticMetricRegistry(final ConcurrentMap<MetricId, Metric> metrics);  SemanticMetricRegistry();  SemanticMetricRegistry(final Supplier<Reservoir> defaultReservoirSupplier);  SemanticMetricRegistry(
        final ConcurrentMap<MetricId, Metric> metrics,
        final Supplier<Reservoir> defaultReservoirSupplier
    ); T register(@NonNull final MetricId name, @NonNull final T metric); void registerAll(final SemanticMetricSet metrics); Counter counter(final MetricId name); Histogram histogram(final MetricId name); Distribution distribution(final MetricId name); Histogram histogram(final MetricId name, Supplier<Reservoir> reservoirSupplier); Meter meter(final MetricId name); Timer timer(final MetricId name); Timer timer(final MetricId name, Supplier<Reservoir> reservoirSupplier); DerivingMeter derivingMeter(final MetricId name); boolean remove(final MetricId name); void removeMatching(final SemanticMetricFilter filter); void addListener(final SemanticMetricRegistryListener listener); void removeListener(final SemanticMetricRegistryListener listener); SortedSet<MetricId> getNames(); @SuppressWarnings("rawtypes") SortedMap<MetricId, Gauge> getGauges(); @SuppressWarnings("rawtypes") SortedMap<MetricId, Gauge> getGauges(final SemanticMetricFilter filter); SortedMap<MetricId, Counter> getCounters(); SortedMap<MetricId, Counter> getCounters(final SemanticMetricFilter filter); SortedMap<MetricId, Histogram> getHistograms(); SortedMap<MetricId, Histogram> getHistograms(final SemanticMetricFilter filter); SortedMap<MetricId, Meter> getMeters(); SortedMap<MetricId, Meter> getMeters(final SemanticMetricFilter filter); SortedMap<MetricId, Timer> getTimers(); SortedMap<MetricId, Timer> getTimers(final SemanticMetricFilter filter); SortedMap<MetricId, DerivingMeter> getDerivingMeters(final SemanticMetricFilter filter); SortedMap<MetricId, Distribution> getDistributions(final SemanticMetricFilter filter); @SuppressWarnings("unchecked") T getOrAdd(
        final MetricId name, final SemanticMetricBuilder<T> builder
    ); @Override Map<MetricId, Metric> getMetrics();  }
@Test public void testRegisterAllEmptyId() { doNothing().when(registry).registerAll(MetricId.EMPTY, set); registry.registerAll(set); verify(registry).registerAll(MetricId.EMPTY, set); }
@Test public void testRegisterAll() { doReturn("a").when(id2).getKey(); doReturn(tags).when(id2).getTags(); final Map<MetricId, Metric> metricSet = ImmutableMap.of(id2, metric); doReturn(metricSet).when(set).getMetrics(); doReturn(null).when(registry).register(any(MetricId.class), any(Metric.class)); registry.registerAll(id, set); verify(registry).register(new MetricId("a", tags), metric); }