### Question:
LeaderNodeRole extends AbstractNodeRole { @Override public NodeId getLeaderId(NodeId selfId) { return selfId; } LeaderNodeRole(int term, LogReplicationTask logReplicationTask); @Override NodeId getLeaderId(NodeId selfId); @Override void cancelTimeoutOrTask(); @Override RoleState getState(); @Override String toString();  }### Answer:
@Test public void testGetNameAndLeaderId() { LeaderNodeRole role = new LeaderNodeRole(1, LogReplicationTask.NONE); RoleNameAndLeaderId state = role.getNameAndLeaderId(NodeId.of("A")); Assert.assertEquals(RoleName.LEADER, state.getRoleName()); Assert.assertEquals(NodeId.of("A"), state.getLeaderId()); }