public LineReaders getLineReaders(Component component) {
    List<LineReader> readers = new ArrayList<>();
    List<CloseableIterator<?>> closeables = new ArrayList<>();
    ScmLineReader scmLineReader = null;

    int componentRef = component.getReportAttributes().getRef();
    CloseableIterator<ScannerReport.LineCoverage> coverageIt = reportReader.readComponentCoverage(componentRef);
    closeables.add(coverageIt);
    readers.add(new CoverageLineReader(coverageIt));

    Optional<ScmInfo> scmInfoOptional = scmInfoRepository.getScmInfo(component);
    if (scmInfoOptional.isPresent()) {
      scmLineReader = new ScmLineReader(scmInfoOptional.get());
      readers.add(scmLineReader);
    }

    RangeOffsetConverter rangeOffsetConverter = new RangeOffsetConverter();
    CloseableIterator<ScannerReport.SyntaxHighlightingRule> highlightingIt = reportReader.readComponentSyntaxHighlighting(componentRef);
    closeables.add(highlightingIt);
    readers.add(new HighlightingLineReader(component, highlightingIt, rangeOffsetConverter));

    CloseableIterator<ScannerReport.Symbol> symbolsIt = reportReader.readComponentSymbols(componentRef);
    closeables.add(symbolsIt);
    readers.add(new SymbolsLineReader(component, symbolsIt, rangeOffsetConverter));
    readers.add(new DuplicationLineReader(duplicationRepository.getDuplications(component)));
    readers.add(new IsNewLineReader(newLinesRepository, component));

    return new LineReadersImpl(readers, scmLineReader, closeables);
  }
@Test
  public void should_create_readers() {
    initBasicReport(10);
    LineReadersImpl lineReaders = (LineReadersImpl) underTest.getLineReaders(fileComponent());

    assertThat(lineReaders).isNotNull();
    assertThat(lineReaders.closeables).hasSize(3);
    assertThat(lineReaders.readers).hasSize(5);
  }