@Test
public void testTrimLogWhenLastAppliedZero() {

    doReturn(0L).when(mockRaftActorContext).getLastApplied();
    ReplicatedLogEntry replicatedLogEntry = mock(ReplicatedLogEntry.class);
    doReturn(true).when(mockReplicatedLog).isPresent(10);
    doReturn(replicatedLogEntry).when(mockReplicatedLog).get(10);
    doReturn(5L).when(replicatedLogEntry).getTerm();
    long retIndex = snapshotManager.trimLog(10);
    assertEquals("return index", -1L, retIndex);
    verify(mockReplicatedLog, never()).snapshotPreCommit(anyLong(), anyLong());
    verify(mockReplicatedLog, never()).snapshotCommit();
    verify(mockRaftActorBehavior, never()).setReplicatedToAllIndex(anyLong());
}