@Test
public void testHaventVoted() {

  BaseState state = new EmptyState(mockRaftLog);
  RequestVote requestVote = RequestVote.newBuilder()
    .setCandidateId(candidate.toString())
    .setLastLogIndex(2)
    .setLastLogTerm(2)
    .setTerm(2)
    .build();
  when(mockRaftLog.votedFor()).thenReturn(Optional.<Replica>empty());
  boolean shouldVote = state.shouldVoteFor(mockRaftLog, requestVote);
  assertTrue(shouldVote);
}