@Test
public void returnsEmptyWithMissingBackfill() throws Exception {

  SortedSet<SequenceEvent> events = newTreeSet(SequenceEvent.COUNTER_COMPARATOR);
  events.add(SequenceEvent.create(
      Event.triggerExecution(WORKFLOW_INSTANCE, Trigger.backfill("bf-1"), TRIGGER_PARAMETERS), 1L, 1L));
  events.add(SequenceEvent.create(Event.dequeue(WORKFLOW_INSTANCE, RESOURCE_IDS),              2L, 2L));
  when(storage.readEvents(WORKFLOW_INSTANCE)).thenReturn(events);
  Optional<RunStateData> restoredRunStateData = ReplayEvents.getBackfillRunStateData(
      WORKFLOW_INSTANCE,
      storage, "erroneous-id");
  assertThat(restoredRunStateData, is(Optional.empty()));
}