@Override
  public CloseableIterator<String> readLines(Component file) {
    requireNonNull(file, "Component should not be null");
    checkArgument(file.getType() == FILE, "Component '%s' is not a file", file);

    Optional<CloseableIterator<String>> linesIteratorOptional = reportReader.readFileSource(file.getReportAttributes().getRef());

    checkState(linesIteratorOptional.isPresent(), "File '%s' has no source code", file);
    CloseableIterator<String> lineIterator = linesIteratorOptional.get();

    return new ComponentLinesCloseableIterator(file, lineIterator, file.getFileAttributes().getLines());
  }
@Test
  public void read_lines_from_report() {
    reportReader.putFileSourceLines(FILE_REF, "line1", "line2");

    assertThat(underTest.readLines(createComponent(2))).toIterable().containsOnly("line1", "line2");
  }