public void execute() {
    Profiler stepProfiler = Profiler.create(LOGGER).logTimeLast(true);
    boolean allStepsExecuted = false;
    try {
      executeSteps(stepProfiler);
      allStepsExecuted = true;
    } finally {
      if (listener != null) {
        executeListener(allStepsExecuted);
      }
    }
  }
@Test
  public void execute_throws_NPE_if_step_adds_statistic_with_null_value() {
    ComputationStep step = new StepWithStatistics("A Step", "foo", "100", "bar", null);

    try (ChangeLogLevel executor = new ChangeLogLevel(ComputationStepExecutor.class, LoggerLevel.INFO)) {
      assertThatThrownBy(() -> new ComputationStepExecutor(mockComputationSteps(step), taskInterrupter).execute())
        .isInstanceOf(NullPointerException.class)
        .hasMessage("Statistic with key [bar] has null value");
    }
  }