public static StepRuntimeState retrieveStepRuntimeState(
      Map<String, Object> data, ObjectMapper objectMapper) {
    Object runtimeSummary =
        data.getOrDefault(Constants.STEP_RUNTIME_SUMMARY_FIELD, Collections.emptyMap());
    if (runtimeSummary instanceof StepRuntimeSummary) {
      return ((StepRuntimeSummary) runtimeSummary).getRuntimeState();
    }
    Object state = ((Map<String, Object>) runtimeSummary).getOrDefault(RUNTIME_STATE_FIELD, null);
    if (state != null) {
      return objectMapper.convertValue(state, StepRuntimeState.class);
    }
    return new StepRuntimeState();
  }
@Test
  public void testRetrieveStepRuntimeStateNotExists() {
    StepRuntimeState expected = new StepRuntimeState();
    Assert.assertEquals(
        expected,
        StepHelper.retrieveStepRuntimeState(
            singletonMap(Constants.STEP_RUNTIME_SUMMARY_FIELD, Collections.emptyMap()), MAPPER));
  }