docs: public long setCommitIndex(long commitIndex) {
      checkArgument(commitIndex >= 0, "commitIndex must be positive");
      long previousCommitIndex = this.commitIndex;
      if (commitIndex > previousCommitIndex) {
        this.commitIndex = commitIndex;
        logWriter.commit(Math.min(commitIndex, logWriter.getLastIndex()));
        long configurationIndex = cluster.getConfiguration().index();
        if (configurationIndex > previousCommitIndex && configurationIndex <= commitIndex) {
          cluster.commit();
        }
        setFirstCommitIndex(commitIndex);
      }
      return previousCommitIndex;
    }