### Question:
MeteredMethodWithRegistryFromString { @Metered(name = "singleMeteredMethod") public void singleMeteredMethod() { }  @Metered(name = "singleMeteredMethod") void singleMeteredMethod();  }### Answer:
@Test public void callMeteredMethodOnce() { assertThat("Shared metric registry is not created", SharedMetricRegistries.names(), hasItem(REGISTRY_NAME)); MetricRegistry registry = SharedMetricRegistries.getOrCreate(REGISTRY_NAME); assertThat("Meter is not registered correctly", registry.getMeters(), hasKey(METER_NAME)); Meter meter = registry.getMeters().get(METER_NAME); instance.singleMeteredMethod(); assertThat("Meter count is incorrect", meter.getCount(), is(equalTo(1L))); }