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