MemoryMonitor extends ProfilerMonitor { @Override public void expand() { myProfilers.setStage(new MemoryProfilerStage(myProfilers)); } MemoryMonitor(@NotNull StudioProfilers profilers); @Override String getName(); @Override TooltipModel buildTooltip(); @Override void enter(); @Override void exit(); @Override void expand(); @NotNull AxisComponentModel getMemoryAxis(); MemoryUsage getMemoryUsage(); MemoryLegend getMemoryLegend(); MemoryLegend getTooltipLegend();  }
@Test public void testExpand() { StudioProfilers profilers = new StudioProfilers(new ProfilerClient(myGrpcChannel.getName()), new FakeIdeProfilerServices(), myTimer); MemoryMonitor monitor = new MemoryMonitor(profilers); Truth.assertThat(profilers.getStage().getClass()).isEqualTo(NullMonitorStage.class); monitor.expand(); Truth.assertThat(profilers.getStage()).isInstanceOf(MemoryProfilerStage.class); }