@Override
  public void finished(boolean allStepsExecuted) {
    if (postProjectAnalysisTasks.length == 0) {
      return;
    }

    ProjectAnalysisImpl projectAnalysis = createProjectAnalysis(allStepsExecuted ? SUCCESS : FAILED);
    for (PostProjectAnalysisTask postProjectAnalysisTask : postProjectAnalysisTasks) {
      executeTask(projectAnalysis, postProjectAnalysisTask);
    }
  }
@Test
  @UseDataProvider("booleanValues")
  public void logStatistics_add_fails_when_NPE_if_key_or_value_is_null(boolean allStepsExecuted) {
    underTest.finished(allStepsExecuted);

    verify(postProjectAnalysisTask).finished(taskContextCaptor.capture());
    PostProjectAnalysisTask.LogStatistics logStatistics = taskContextCaptor.getValue().getLogStatistics();

    assertThat(catchThrowable(() -> logStatistics.add(null, "foo")))
      .isInstanceOf(NullPointerException.class)
      .hasMessage("Statistic has null key");
    assertThat(catchThrowable(() -> logStatistics.add(null, null)))
      .isInstanceOf(NullPointerException.class)
      .hasMessage("Statistic has null key");
    assertThat(catchThrowable(() -> logStatistics.add("bar", null)))
      .isInstanceOf(NullPointerException.class)
      .hasMessage("Statistic with key [bar] has null value");
  }