@Test
public void testFinalState() {

  setStartupProgressForFinalState(startupProgress);
  MetricsRecordBuilder builder = getMetrics(metrics, true);
  assertTrue(getLongCounter("ElapsedTime", builder) >= 0L);
  assertGauge("PercentComplete", 1.0f, builder);
  assertCounter("LoadingFsImageCount", 100L, builder);
  assertTrue(getLongCounter("LoadingFsImageElapsedTime", builder) >= 0L);
  assertCounter("LoadingFsImageTotal", 100L, builder);
  assertGauge("LoadingFsImagePercentComplete", 1.0f, builder);
  assertCounter("LoadingEditsCount", 200L, builder);
  assertTrue(getLongCounter("LoadingEditsElapsedTime", builder) >= 0L);
  assertCounter("LoadingEditsTotal", 200L, builder);
  assertGauge("LoadingEditsPercentComplete", 1.0f, builder);
  assertCounter("SavingCheckpointCount", 300L, builder);
  assertTrue(getLongCounter("SavingCheckpointElapsedTime", builder) >= 0L);
  assertCounter("SavingCheckpointTotal", 300L, builder);
  assertGauge("SavingCheckpointPercentComplete", 1.0f, builder);
  assertCounter("SafeModeCount", 400L, builder);
  assertTrue(getLongCounter("SafeModeElapsedTime", builder) >= 0L);
  assertCounter("SafeModeTotal", 400L, builder);
  assertGauge("SafeModePercentComplete", 1.0f, builder);
}