### Question:
CandidateNodeRole extends AbstractNodeRole { @Override public NodeId getLeaderId(NodeId selfId) { return null; } 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 testGetRoleNameAndLeaderId() { CandidateNodeRole role = new CandidateNodeRole(1, ElectionTimeout.NONE); RoleNameAndLeaderId state = role.getNameAndLeaderId(NodeId.of("A")); Assert.assertEquals(RoleName.CANDIDATE, state.getRoleName()); Assert.assertNull(state.getLeaderId()); }