@Override
  public CloseableIterator<String> readScannerLogs() {
    ensureInitialized();
    File file = delegate.getFileStructure().analysisLog();
    if (!file.exists()) {
      return CloseableIterator.emptyCloseableIterator();
    }
    try {
      InputStreamReader reader = new InputStreamReader(FileUtils.openInputStream(file), UTF_8);
      return new LineReaderIterator(reader);
    } catch (IOException e) {
      throw new IllegalStateException("Fail to open file " + file, e);
    }
  }
@Test
  public void readScannerLogs() throws IOException {
    File scannerLogFile = writer.getFileStructure().analysisLog();
    FileUtils.write(scannerLogFile, "log1\nlog2");

    CloseableIterator<String> logs = underTest.readScannerLogs();
    assertThat(logs).toIterable().containsExactly("log1", "log2");
  }