@Override
    public String trackTicket(final Ticket ownerTicket, final Ticket ticket) {
        if (ownerTicket instanceof final TicketGrantingTicket tgt) {
            var trackedEntry = ticket.getId();
            if (ticket instanceof final ServiceAwareTicket sat) {
                trackedEntry += DELIMITER + sat.getService().getId();
            }
            tgt.getDescendantTickets().add(trackedEntry);
            return trackedEntry;
        }
        return TicketTrackingPolicy.super.trackTicket(ownerTicket, ticket);
    }
This is the default tracking policy for descendant tickets.

@author Jerome LELEU
@since 7.0.0
core/cas-server-core-tickets-api/src/main/java/org/apereo/cas/ticket/tracking/DefaultDescendantTicketsTrackingPolicy.java