public Optional<LineRange[]> getRangesPerLine(Component component) {
    int numLines = component.getFileAttributes().getLines();

    Optional<CloseableIterator<LineSgnificantCode>> opt = reportReader.readComponentSignificantCode(component.getReportAttributes().getRef());
    if (!opt.isPresent()) {
      return Optional.empty();
    }
    try (CloseableIterator<LineSgnificantCode> significantCode = opt.get()) {
      return Optional.of(toArray(significantCode, numLines));
    }
  }
@Test
  public void return_null_for_lines_without_information() {
    Component component = createComponent(5);
    List<ScannerReport.LineSgnificantCode> significantCode = new ArrayList<>();

    // line 3 and 5 missing
    significantCode.add(createLineSignificantCode(1, 1, 2));
    significantCode.add(createLineSignificantCode(2, 1, 2));
    significantCode.add(createLineSignificantCode(4, 1, 2));

    reportReader.putSignificantCode(component.getReportAttributes().getRef(), significantCode);
    assertThat(underTest.getRangesPerLine(component)).isNotEmpty();
    LineRange[] lines = underTest.getRangesPerLine(component).get();
    assertThat(lines).hasSize(5);
    assertThat(lines[0]).isNotNull();
    assertThat(lines[1]).isNotNull();
    assertThat(lines[2]).isNull();
    assertThat(lines[3]).isNotNull();
    assertThat(lines[4]).isNull();
  }