@SuppressWarnings("unchecked")
@Test
public void testIllegalCapture() {

    boolean capture = snapshotManager.capture(new SimpleReplicatedLogEntry(9, 1,
            new MockRaftActorContext.MockPayload()), 9);
    assertTrue(capture);
    verify(mockProcedure).accept(any());
    reset(mockProcedure);
    // This will not cause snapshot capture to start again
    capture = snapshotManager.capture(new SimpleReplicatedLogEntry(9, 1,
            new MockRaftActorContext.MockPayload()), 9);
    assertFalse(capture);
    verify(mockProcedure, never()).accept(any());
}