@JsonIgnore
  public Set<Long> getSkippedIterationsInRange(int startInstanceId, Long ancestorMax) {
    if (details == null || ancestorMax == null || ancestorMax.intValue() < startInstanceId) {
      return Collections.emptySet();
    }
    return details
        .flatten(e -> e == WorkflowInstance.Status.SUCCEEDED)
        .getOrDefault(WorkflowInstance.Status.SUCCEEDED, Collections.emptyList())
        .stream()
        .filter(iterId -> iterId >= startInstanceId)
        .collect(Collectors.toSet());
  }
@Test
  public void testGetSkippedIterationsInRange() throws Exception {
    ForeachStepOverview overview =
        loadObject(
            "fixtures/instances/sample-foreach-step-overview.json", ForeachStepOverview.class);
    assertEquals(Collections.emptySet(), overview.getSkippedIterationsInRange(10, null));
    assertEquals(Collections.emptySet(), overview.getSkippedIterationsInRange(100, 10L));
    assertEquals(
        Collections.singleton(80115L), overview.getSkippedIterationsInRange(80115, 80115L));

    overview = new ForeachStepOverview();
    assertEquals(Collections.emptySet(), overview.getSkippedIterationsInRange(10, 10L));
  }