MemoryUsage extends LineChartModel { @NotNull public RangedContinuousSeries getTotalMemorySeries() { return myTotalMemorySeries; } MemoryUsage(@NotNull StudioProfilers profilers); @NotNull Range getMemoryRange(); @NotNull RangedContinuousSeries getTotalMemorySeries();  }
@Test public void testNewPipelineGetData() { MemoryUsage usage = new MemoryUsage(myProfilers); RangedContinuousSeries rangedSeries = usage.getTotalMemorySeries(); Range range = rangedSeries.getXRange(); range.set(0, TimeUnit.SECONDS.toMicros(100)); List<SeriesData<Long>> series = rangedSeries.getSeries(); Truth.assertThat(series.size()).isEqualTo(10); for (int i = 0; i < series.size(); i++) { Truth.assertThat(series.get(i).value).isEqualTo(i * 10); } range.set(TimeUnit.SECONDS.toMicros(-50), TimeUnit.SECONDS.toMicros(45)); series = rangedSeries.getSeries(); Truth.assertThat(series.size()).isEqualTo(6); for (int i = 0; i < series.size(); i++) { Truth.assertThat(series.get(i).value).isEqualTo(i * 10); } range.set(TimeUnit.SECONDS.toMicros(45), TimeUnit.SECONDS.toMicros(200)); series = rangedSeries.getSeries(); Truth.assertThat(series.size()).isEqualTo(6); for (int i = 0; i < series.size(); i++) { Truth.assertThat(series.get(i).value).isEqualTo((i + 4) * 10); } }