### Question:
CandidateNodeRole extends AbstractNodeRole { @Override public RoleState getState() { DefaultRoleState state = new DefaultRoleState(RoleName.CANDIDATE, term); state.setVotesCount(votesCount); return state; } CandidateNodeRole(int term, ElectionTimeout electionTimeout);  CandidateNodeRole(int term, int votesCount, ElectionTimeout electionTimeout); int getVotesCount(); @Override NodeId getLeaderId(NodeId selfId); @Override void cancelTimeoutOrTask(); @Override RoleState getState(); @Override String toString();  }### Answer:
@Test public void testGetState() { CandidateNodeRole role = new CandidateNodeRole(1, 2, ElectionTimeout.NONE); RoleState state = role.getState(); Assert.assertEquals(RoleName.CANDIDATE, state.getRoleName()); Assert.assertEquals(1, state.getTerm()); Assert.assertEquals(2, state.getVotesCount()); }