@Test
public void testHandleAppendEntriesAfterInstallingSnapshot() {

    logStart("testHandleAppendAfterInstallingSnapshot");
    MockRaftActorContext context = createActorContext();
    // Prepare the receivers log
    MockRaftActorContext.SimpleReplicatedLog log = new MockRaftActorContext.SimpleReplicatedLog();
    // Set up a log as if it has been snapshotted
    log.setSnapshotIndex(3);
    log.setSnapshotTerm(1);
    context.setReplicatedLog(log);
    // Prepare the entries to be sent with AppendEntries
    List<ReplicatedLogEntry> entries = new ArrayList<>();
    entries.add(newReplicatedLogEntry(1, 4, "four"));
    AppendEntries appendEntries = new AppendEntries(1, "leader", 3, 1, entries, 4, 3, (short)0);
    follower = createBehavior(context);
    RaftActorBehavior newBehavior = follower.handleMessage(leaderActor, appendEntries);
    Assert.assertSame(follower, newBehavior);
    expectAndVerifyAppendEntriesReply(1, true, context.getId(), 1, 4);
}