docs: protected CompletableFuture<AppendResponse> handleAppend(final AppendRequest request) {
      CompletableFuture<AppendResponse> future = new CompletableFuture<>();
  
      // Check that the term of the given request matches the local term or update the term.
      if (!checkTerm(request, future)) {
        return future;
      }
  
      // Check that the previous index/term matches the local log's last entry.
      if (!checkPreviousEntry(request, future)) {
        return future;
      }
  
      // Append the entries to the log.
      appendEntries(request, future);
      return future;
    }