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_no_changeset() {
    assertThatThrownBy(() -> ReportScmInfo.create(ScannerReport.Changesets.newBuilder().build()))
      .isInstanceOf(IllegalStateException.class)
      .hasMessageContaining("ScmInfo cannot be empty");
  }