@Test
public void testRemoveFromAndPersist() throws Exception {

    ReplicatedLog log = ReplicatedLogImpl.newInstance(context);
    log.append(new SimpleReplicatedLogEntry(0, 1, new MockPayload("0")));
    log.append(new SimpleReplicatedLogEntry(1, 1, new MockPayload("1")));
    log.append(new SimpleReplicatedLogEntry(2, 1, new MockPayload("2")));
    log.removeFromAndPersist(1);
    DeleteEntries deleteEntries = new DeleteEntries(1);
    verifyPersist(deleteEntries, match(deleteEntries), false);
    assertEquals("size", 1, log.size());
    reset(mockPersistence);
    log.removeFromAndPersist(1);
    verifyNoMoreInteractions(mockPersistence);
}