public static ScmInfo create(ScannerReport.Changesets changesets) {
    requireNonNull(changesets);
    Changeset[] lineChangesets = new Changeset[changesets.getChangesetIndexByLineCount()];
    LineIndexToChangeset lineIndexToChangeset = new LineIndexToChangeset(changesets);

    for (int i = 0; i < changesets.getChangesetIndexByLineCount(); i++) {
      lineChangesets[i] = lineIndexToChangeset.apply(i);
    }

    return new ScmInfoImpl(lineChangesets);
  }
@Test
  public void fail_with_ISE_when_changeset_has_no_revision() {
    assertThatThrownBy(() -> {
      ReportScmInfo.create(ScannerReport.Changesets.newBuilder()
        .setComponentRef(FILE_REF)
        .addChangeset(ScannerReport.Changesets.Changeset.newBuilder()
          .setAuthor("john")
          .setDate(123456789L)
          .build())
        .addChangesetIndexByLine(0)
        .build());
    })
      .isInstanceOf(IllegalStateException.class)
      .hasMessage("Changeset on line 1 must have a revision");
  }