@Test
public void testActivityDiedThenResumed() {

  buildActivityEvent(ACTIVITY_NAME,
                     new ActivityStateData[]{
                       new ActivityStateData(Interaction.ViewData.State.CREATED,
                                             TEST_START_TIME_NS),
                       new ActivityStateData(Interaction.ViewData.State.RESUMED,
                                             TEST_START_TIME_NS),
                       new ActivityStateData(Interaction.ViewData.State.PAUSED,
                                             TEST_START_TIME_NS),
                       new ActivityStateData(Interaction.ViewData.State.DESTROYED,
                                             TEST_START_TIME_NS),
                       new ActivityStateData(Interaction.ViewData.State.REMOVED,
                                             TEST_START_TIME_NS),
                       new ActivityStateData(Interaction.ViewData.State.CREATED,
                                             TEST_START_TIME_NS),
                       new ActivityStateData(Interaction.ViewData.State.RESUMED,
                                             TEST_START_TIME_NS),
                       new ActivityStateData(Interaction.ViewData.State.PAUSED,
                                             TEST_END_TIME_NS),
                       new ActivityStateData(Interaction.ViewData.State.DESTROYED,
                                             TEST_END_TIME_NS),
                     },
                     0);
  Range range = new Range(TimeUnit.NANOSECONDS.toMicros(TEST_START_TIME_NS), TimeUnit.NANOSECONDS.toMicros(TEST_END_TIME_NS));
  List<SeriesData<EventAction<LifecycleEvent>>> dataList = myActivitySeries.getDataForRange(range);
  assertThat(dataList).hasSize(2);
  SeriesData<EventAction<LifecycleEvent>> event = dataList.get(0);
  verifyActivity(event, TEST_START_TIME_NS);
  assertThat(event.value.getType()).isEqualTo(LifecycleEvent.COMPLETED);
  assertThat(((LifecycleAction)event.value).getName()).isEqualTo(
    String.format("%s - %s - %s", ACTIVITY_NAME, Interaction.ViewData.State.DESTROYED.toString().toLowerCase(),
                  Interaction.ViewData.State.REMOVED.toString().toLowerCase()));
  event = dataList.get(1);
  verifyActivity(event, TEST_END_TIME_NS);
  assertThat(event.value.getType()).isEqualTo(LifecycleEvent.COMPLETED);
  assertThat(((LifecycleAction)event.value).getName()).isEqualTo(
    String.format("%s - %s", ACTIVITY_NAME, Interaction.ViewData.State.DESTROYED.toString().toLowerCase()));
}