/** Startup the live activity, then shut it down. */
  @Test
  public void directActivityStartupAndShutdown() {
    activeLiveActivity.startup();
    activeLiveActivity.shutdown();

    assertActiveActivityState(
        activeLiveActivity,
        false,
        0,
        false,
        0,
        ActivityState.SHUTDOWN_ATTEMPT,
        ActivityState.UNKNOWN);
    Mockito.verify(remoteControllerClient, Mockito.times(1)).startupActivity(activeLiveActivity);
    Mockito.verify(remoteControllerClient, Mockito.times(1)).shutdownActivity(activeLiveActivity);
  }
  /** Activate the live activity from two groups without a startup, then deactivate from 1. */
  @Test
  public void groupTwoActivityActivateAndOneDeactivate() {
    activeLiveActivity.activateFromLiveActivityGroup(activeLiveActivityGroup1);
    activeLiveActivity.activateFromLiveActivityGroup(activeLiveActivityGroup2);
    activeLiveActivity.deactivateFromLiveActivityGroup(activeLiveActivityGroup1);

    assertActiveActivityState(
        activeLiveActivity,
        false,
        2,
        false,
        1,
        ActivityState.ACTIVATE_ATTEMPT,
        ActivityState.UNKNOWN);
    Mockito.verify(remoteControllerClient, Mockito.times(0)).deactivateActivity(activeLiveActivity);
  }
  /** Startup the live activity from two groups and shutdown from 1. */
  @Test
  public void groupTwoActivityStartupAndOneShutdown() {
    activeLiveActivity.startupFromLiveActivityGroup(activeLiveActivityGroup1);
    activeLiveActivity.startupFromLiveActivityGroup(activeLiveActivityGroup2);
    activeLiveActivity.shutdownFromLiveActivityGroup(activeLiveActivityGroup1);

    assertActiveActivityState(
        activeLiveActivity,
        false,
        1,
        false,
        0,
        ActivityState.STARTUP_ATTEMPT,
        ActivityState.UNKNOWN);
    Mockito.verify(remoteControllerClient, Mockito.times(0)).shutdownActivity(activeLiveActivity);
  }
  /** Startup the live activity */
  @Test
  public void directActivityStartup() {
    activeLiveActivity.startup();

    assertActiveActivityState(
        activeLiveActivity,
        true,
        0,
        false,
        0,
        ActivityState.STARTUP_ATTEMPT,
        ActivityState.UNKNOWN);
    Mockito.verify(remoteControllerClient, Mockito.times(1)).startupActivity(activeLiveActivity);
  }
  /** directly activate the live activity with no startup. */
  @Test
  public void directActivityActivate() {
    activeLiveActivity.activate();

    assertActiveActivityState(
        activeLiveActivity,
        true,
        0,
        true,
        0,
        ActivityState.ACTIVATE_ATTEMPT,
        ActivityState.UNKNOWN);
    Mockito.verify(remoteControllerClient, Mockito.times(1)).activateActivity(activeLiveActivity);
  }
  /** Activate the live activity from a group, then shut it down from a group. */
  @Test
  public void groupActivityActivateAndShutdown() {
    activeLiveActivity.activateFromLiveActivityGroup(activeLiveActivityGroup1);

    assertActiveActivityState(
        activeLiveActivity,
        false,
        1,
        false,
        1,
        ActivityState.ACTIVATE_ATTEMPT,
        ActivityState.UNKNOWN);

    activeLiveActivity.shutdownFromLiveActivityGroup(activeLiveActivityGroup1);

    assertActiveActivityState(
        activeLiveActivity,
        false,
        0,
        false,
        0,
        ActivityState.SHUTDOWN_ATTEMPT,
        ActivityState.UNKNOWN);
  }