@Test
public void testOkToReplicate() {

    MockRaftActorContext context = new MockRaftActorContext();
    context.setCommitIndex(0);
    FollowerLogInformation followerLogInformation =
            new FollowerLogInformation(new PeerInfo("follower1", null, VotingState.VOTING), 10, context);
    followerLogInformation.setSentCommitIndex(0);
    assertTrue(followerLogInformation.okToReplicate(0));
    assertFalse(followerLogInformation.okToReplicate(0));
    // wait for 150 milliseconds and it should work again
    Uninterruptibles.sleepUninterruptibly(150, TimeUnit.MILLISECONDS);
    assertTrue(followerLogInformation.okToReplicate(0));
    //increment next index and try immediately and it should work again
    followerLogInformation.incrNextIndex();
    assertTrue(followerLogInformation.okToReplicate(0));
}