public static BundleCounter bundleProcessingThreadCounter(String shortId, MetricName name) {
    return new BundleProcessingThreadCounter(shortId, name);
  }
@Test
  public void testAccurateBundleCounterReportsValueFirstTimeWithoutMutations() throws Exception {
    Map<String, ByteString> report = new HashMap<>();
    BundleCounter bundleCounter = Metrics.bundleProcessingThreadCounter(TEST_ID, TEST_NAME);
    bundleCounter.updateIntermediateMonitoringData(report);
    assertEquals(
        report, Collections.singletonMap(TEST_ID, MonitoringInfoEncodings.encodeInt64Counter(0)));
    report.clear();
    // Test that a reported value isn't reported again on final update
    bundleCounter.updateFinalMonitoringData(report);
    assertEquals(report, Collections.emptyMap());

    // Test that the value is not reported after reset if no mutations after being
    // reported the first time.
    bundleCounter.reset();
    bundleCounter.updateFinalMonitoringData(report);
    assertEquals(report, Collections.emptyMap());
  }