@Test
public void selectionDisabledWithoutAgent() {

  Range selection = myStage.getTimeline().getSelectionRange();
  myTransportService.setAgentStatus(DEFAULT_AGENT_ATTACHED_RESPONSE);
  myTimer.tick(TimeUnit.SECONDS.toNanos(1));
  // Need to re-enter the stage again given the device/process can be set and return to the default StudioMonitorStage.
  myStage.getStudioProfilers().setStage(myStage);
  assertThat(myStage.getStudioProfilers().isAgentAttached()).isTrue();
  myStage.getRangeSelectionModel().set(0, 100);
  assertThat(selection.getMin()).isWithin(EPSILON).of(0);
  assertThat(selection.getMax()).isWithin(EPSILON).of(100);
  myTransportService.setAgentStatus(DEFAULT_AGENT_DETACHED_RESPONSE);
  myTimer.tick(TimeUnit.SECONDS.toNanos(1));
  assertThat(myStage.getStudioProfilers().isAgentAttached()).isFalse();
  // Attempting to select a range should do nothing.
  myStage.getRangeSelectionModel().set(100, 200);
  assertThat(selection.getMin()).isWithin(EPSILON).of(0);
  assertThat(selection.getMax()).isWithin(EPSILON).of(100);
}