@Test
public void testLegacyGetDataForXRange() {

  myIdeProfilerServices.enableEventsPipeline(false);
  myService.addExplicitHeapDumpInfo(INFO1);
  myService.addExplicitHeapDumpInfo(INFO2);
  HeapDumpSampleDataSeries series =
    new HeapDumpSampleDataSeries(new ProfilerClient(myGrpcChannel.getName()), ProfilersTestData.SESSION_DATA,
                                 myIdeProfilerServices.getFeatureTracker(), myStage);
  List<SeriesData<CaptureDurationData<CaptureObject>>> dataList =
    series.getDataForRange(new Range(0, Double.MAX_VALUE));
  assertEquals(2, dataList.size());
  SeriesData<CaptureDurationData<CaptureObject>> data1 = dataList.get(0);
  assertEquals(2, data1.x);
  assertEquals(5, data1.value.getDurationUs());
  CaptureObject capture1 = data1.value.getCaptureEntry().getCaptureObject();
  assertEquals(TimeUnit.MICROSECONDS.toNanos(2), capture1.getStartTimeNs());
  assertEquals(TimeUnit.MICROSECONDS.toNanos(7), capture1.getEndTimeNs());
  SeriesData<CaptureDurationData<CaptureObject>> data2 = dataList.get(1);
  assertEquals(17, data2.x);
  assertEquals(Long.MAX_VALUE, data2.value.getDurationUs());
  CaptureObject capture2 = data2.value.getCaptureEntry().getCaptureObject();
  assertEquals(TimeUnit.MICROSECONDS.toNanos(17), capture2.getStartTimeNs());
  assertEquals(Long.MAX_VALUE, capture2.getEndTimeNs());
}