### Question:
Metrics { public static <T extends Metric> Metric register(String name, T metric) { return metrics.register(name, metric); }  static void startMicroscopeReporter(); static void startMicroscopeReporter(long period, TimeUnit unit); static void startSlf4jReporter(); static void startSlf4jReporter(long period, TimeUnit unit); static void startConsoleReporter(); static void startConsoleReporter(long period, TimeUnit unit); static void startCsvReporter(); static void startCsvReporter(long period, TimeUnit unit); static void startJmxReporter(); static void startGraphiteReporter(); static void startGraphiteReporter(long period, TimeUnit unit); static void startGangliaReporter(); static void startGangliaReporter(long period, TimeUnit unit); static void registerJVM(); static Metric register(String name, T metric); void registerAll(MetricSet metricset); static Counter counter(String name); static void inc(String name); static void inc(String name, long n); static void dec(String name); static void dec(String name, long n); static Histogram histogram(String name); static Meter meter(String name); static Timer timer(String name); boolean remove(String name); void removeMatching(MetricFilter filter); void addListener(MetricRegistryListener listener); void removeListener(MetricRegistryListener listener); SortedSet<String> getNames(); SortedMap<String, Gauge> getGauges(); SortedMap<String, Gauge> getGauges(MetricFilter filter); SortedMap<String, Counter> getCounters(); SortedMap<String, Counter> getCounters(MetricFilter filter); SortedMap<String, Histogram> getHistograms(); SortedMap<String, Histogram> getHistograms(MetricFilter filter); SortedMap<String, Meter> getMeters(); SortedMap<String, Meter> getMeters(MetricFilter filter); SortedMap<String, Timer> getTimers(); SortedMap<String, Timer> getTimers(MetricFilter filter); static void register(String name, HealthCheck healthCheck); static void unregister(String name); static SortedSet<String> getHealthNames(); static HealthCheck.Result runHealthCheck(String name); static SortedMap<String, HealthCheck.Result> runHealthChecks(); static SortedMap<String, HealthCheck.Result> runHealthChecks(ExecutorService executor);  }### Answer:
@Test public void testRegister() throws InterruptedException { Metrics.startSlf4jReporter(1, TimeUnit.SECONDS); final Queue<String> queue = new LinkedBlockingDeque<String>(); Metrics.register("queue-size", new Gauge<Integer>() { @Override public Integer getValue() { return queue.size(); } }); for (int i = 0; i < 5; i++) { queue.add("1"); TimeUnit.SECONDS.sleep(1); } }