@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 fail_with_NPE_to_read_lines_on_null_component() {
    assertThatThrownBy(() -> underTest.readLines(null))
      .isInstanceOf(NullPointerException.class)
      .hasMessage("Component should not be null");
  }