@Override
  public void execute(Context context) {
    Collection<CeTaskMessages.Message> warnings = new ArrayList<>();
    try (CloseableIterator<ScannerReport.AnalysisWarning> it = reportReader.readAnalysisWarnings()) {
      it.forEachRemaining(w -> warnings.add(new CeTaskMessages.Message(w.getText(), w.getTimestamp())));
    }
    if (!warnings.isEmpty()) {
      ceTaskMessages.addAll(warnings);
    }
  }
@Test
  public void execute_persists_warnings_from_reportReader() {
    ScannerReport.AnalysisWarning warning1 = ScannerReport.AnalysisWarning.newBuilder().setText("warning 1").build();
    ScannerReport.AnalysisWarning warning2 = ScannerReport.AnalysisWarning.newBuilder().setText("warning 2").build();
    ImmutableList<ScannerReport.AnalysisWarning> warnings = of(warning1, warning2);
    reportReader.setAnalysisWarnings(warnings);

    underTest.execute(new TestComputationStepContext());

    verify(ceTaskMessages, times(1)).addAll(argumentCaptor.capture());
    assertThat(argumentCaptor.getValue())
      .extracting(CeTaskMessages.Message::getText, CeTaskMessages.Message::getType)
      .containsExactly(tuple("warning 1", MessageType.GENERIC), tuple("warning 2", MessageType.GENERIC));
  }