@VisibleForTesting
  void initializeForeachArtifactRollup(
      ForeachStepOverview foreachOverview,
      ForeachStepOverview prevForeachOverview,
      String foreachWorkflowId) {
    Set<Long> iterationsToRunInNewRun =
        foreachOverview.getIterationsToRunFromDetails(prevForeachOverview);
    WorkflowRollupOverview aggregatedRollupsPrevRun =
        getAggregatedRollupFromIterations(foreachWorkflowId, iterationsToRunInNewRun);

    foreachOverview.initiateStepRollup(prevForeachOverview.getRollup(), aggregatedRollupsPrevRun);
  }
@Test
  public void testGetAggregatedRollupFromIterationsNull() {
    doReturn(Collections.singletonList(new WorkflowRollupOverview()))
        .when(workflowInstanceDao)
        .getBatchForeachLatestRunRollupForIterations(anyString(), any());
    ForeachStepOverview stepOverview = mock(ForeachStepOverview.class);
    ForeachStepOverview prevStepOverview = new ForeachStepOverview();
    doReturn(null).when(stepOverview).getIterationsToRunFromDetails(any());
    foreachStepRuntime.initializeForeachArtifactRollup(
        stepOverview, prevStepOverview, "myworkflowid");
    assertNull(stepOverview.getRollup());
    Mockito.verify(workflowInstanceDao, times(0))
        .getBatchForeachLatestRunRollupForIterations(eq("myworkflowid"), any());
  }