Proof using.
unfold handleAppendEntries, advanceCurrentTerm;
intros; repeat break_match; repeat find_inversion; simpl; auto.
Qed.

(* Specifications: *)
Lemma sorted_maxIndex_app :
forall l1 l2,
sorted (l1 ++ l2) ->
maxIndex l2 <= maxIndex (l1 ++ l2).