public static synchronized Class<? extends HeartbeatTimer> getTimerClass(String name) {
    return sTimerClasses.get(name);
  }
@Test
  public void canTemporarilySwitchToScheduledTimer() throws Exception {
    try (ManuallyScheduleHeartbeat.Resource h =
        new ManuallyScheduleHeartbeat.Resource(ImmutableList.of(HeartbeatContext.WORKER_CLIENT))) {
      assertTrue(HeartbeatContext.getTimerClass(HeartbeatContext.WORKER_CLIENT)
          .isAssignableFrom(ScheduledTimer.class));
    }
    assertTrue(HeartbeatContext.getTimerClass(HeartbeatContext.WORKER_CLIENT)
        .isAssignableFrom(SleepingTimer.class));
  }