@Test
public void testMonitorExpansion() {

  // Set session to enable Energy Monitor.
  myProfilerService.addSession(SESSION_O, SESSION_O_METADATA);
  myTimer.tick(FakeTimer.ONE_SECOND_IN_NS);
  myProfilers.getSessionsManager().setSession(SESSION_O);
  myUi.layout();
  assertThat(myProfilers.getStage()).isInstanceOf(StudioMonitorStage.class);
  List<Point> points = new TreeWalker(myView.getComponent()).descendantStream()
    .filter(d -> d instanceof LineChart)
    .map(c -> myUi.getPosition(c))
    .collect(Collectors.toList());
  // Test that we have the expected number of monitors
  assertThat(points.size()).isEqualTo(4);
  // Test the first monitor goes to cpu profiler
  myUi.mouse.click(points.get(0).x + 1, points.get(0).y + 1);
  assertThat(myProfilers.getStage()).isInstanceOf(CpuProfilerStage.class);
  myProfilers.setMonitoringStage();
  myUi.layout();
  // Test the second monitor goes to memory profiler
  myUi.mouse.click(points.get(1).x + 1, points.get(1).y + 1);
  assertThat(myProfilers.getStage()).isInstanceOf(MemoryProfilerStage.class);
  myProfilers.setMonitoringStage();
  myUi.layout();
  // Test the third monitor goes to network profiler
  myUi.mouse.click(points.get(2).x + 1, points.get(2).y + 1);
  assertThat(myProfilers.getStage()).isInstanceOf(NetworkProfilerStage.class);
  myProfilers.setMonitoringStage();
  myUi.layout();
  // Test the fourth monitor goes to energy profiler
  myUi.mouse.click(points.get(3).x + 1, points.get(3).y + 1);
  assertThat(myProfilers.getStage()).isInstanceOf(EnergyProfilerStage.class);
  myProfilers.setMonitoringStage();
}