code: protected AppendResponse handleAppend(AppendRequest request) {
      // If the request term is less than the current term then immediately
      // reply false and return our current term. The leader will receive
      // the updated term and step down.
      if (request.term() < context.getTerm()) {
        LOGGER.debug("{} - Rejected {}: request term is less than the current term ({})", context.getCluster().member().address(), request, context.getTerm());
        return AppendResponse.builder()
          .withStatus(Response.Status.OK)
          .withTerm(context.getTerm())
          .withSucceeded(false)
          .withLogIndex(context.getLog().lastIndex())
          .build();
      } else {
        return checkGlobalIndex(request);
      }
    }
docs: Handles an append request.