@Test
public void testHandleAppendEntriesWithNewerCommitIndex() {

    logStart("testHandleAppendEntriesWithNewerCommitIndex");
    MockRaftActorContext context = createActorContext();
    context.setLastApplied(100);
    setLastLogEntry(context, 1, 100,
            new MockRaftActorContext.MockPayload(""));
    context.getReplicatedLog().setSnapshotIndex(99);
    List<ReplicatedLogEntry> entries = Arrays.<ReplicatedLogEntry>asList(
            newReplicatedLogEntry(2, 101, "foo"));
    // The new commitIndex is 101
    AppendEntries appendEntries = new AppendEntries(2, "leader-1", 100, 1, entries, 101, 100, (short)0);
    follower = createBehavior(context);
    follower.handleMessage(leaderActor, appendEntries);
    assertEquals("getLastApplied", 101L, context.getLastApplied());
}