Object getFromForeach(String foreachStepId, String stepId, String paramName) {
    try {
      return executor
          .submit(() -> fromForeach(foreachStepId, stepId, paramName))
          .get(TIMEOUT_IN_MILLIS, TimeUnit.MILLISECONDS);
    } catch (Exception e) {
      throw new MaestroInternalError(
          e,
          "getFromForeach throws an exception for foreachStepId=[%s], stepId=[%s], paramName=[%s]",
          foreachStepId,
          stepId,
          paramName);
    }
  }
@Test
  public void testGetFromForeach() throws Exception {
    StepRuntimeSummary summary = loadObject(TEST_STEP_RUNTIME_SUMMARY, StepRuntimeSummary.class);
    when(allStepOutputData.get("foreach-job"))
        .thenReturn(Collections.singletonMap("maestro_step_runtime_summary", summary));
    when(stepInstanceDao.getForeachParamType(any(), any(), any())).thenReturn(ParamType.LONG);
    when(stepInstanceDao.getEvaluatedResultsFromForeach(any(), any(), any()))
        .thenReturn(Collections.singletonMap(1L, "12"));
    long[] res = (long[]) paramExtension.getFromForeach("foreach-job", "job1", "sleep_seconds");
    assertArrayEquals(new long[] {12, 0, 0, 0, 0, 0}, res);
  }