@Test
public void testCheckup() throws IOException {

  MockClock clk = new MockClock(0);
  Clock.setClock(clk);
  StatusManager stats = new StatusManager();
  // foo is in state HELLO and has configuration numbered 0
  long prev = Clock.unixTime();
  boolean needsRefresh = stats.updateHeartbeatStatus(NetUtils.localhost(),
      "physnode", "foo", NodeState.HELLO, 0);
  LOG.info(stats.getNodeStatuses());
  assertTrue(needsRefresh);
  // move forward in time, but not far enough to trigger being lost
  clk.forward(FlumeConfiguration.get().getConfigHeartbeatPeriod() * 5);
  stats.checkup();
  StatusManager.NodeStatus ns = stats.getNodeStatuses().get("foo");
  assertEquals(0, ns.version);
  assertTrue(prev <= ns.lastseen);
  assertEquals(NodeState.HELLO, ns.state);
  prev = ns.lastseen;
  clk.forward(FlumeConfiguration.get().getConfigHeartbeatPeriod() * 20);
  stats.checkup();
  ns = stats.getNodeStatuses().get("foo");
  assertEquals(0, ns.version);
  assertTrue(prev <= ns.lastseen);
  assertEquals(NodeState.LOST, ns.state);
  prev = ns.lastseen;
  LOG.info(ns.toString());
  LOG.info(stats.getStatus("foo").toString());
}