@Test
public void testSupervise() throws LifecycleException, InterruptedException {

  supervisor.start();
  /* Attempt to supervise a known-to-fail config. */
  /*
   * LogicalNode node = new LogicalNode(); SupervisorPolicy policy = new
   * SupervisorPolicy.OnceOnlyPolicy(); supervisor.supervise(node, policy,
   * LifecycleState.START);
   */
  CountingLifecycleAware node = new CountingLifecycleAware();
  SupervisorPolicy policy = new SupervisorPolicy.OnceOnlyPolicy();
  supervisor.supervise(node, policy, LifecycleState.START);
  Thread.sleep(10000);
  node = new CountingLifecycleAware();
  policy = new SupervisorPolicy.OnceOnlyPolicy();
  supervisor.supervise(node, policy, LifecycleState.START);
  Thread.sleep(5000);
  supervisor.stop();
}