@Override
    public long countTickets(final Ticket ticketGrantingTicket, final String ticketId) {
        if (ticketGrantingTicket instanceof final TicketGrantingTicket tgt) {
            return tgt.getDescendantTickets()
                .stream()
                .map(this::extractTicket)
                .filter(StringUtils::isNotBlank)
                .filter(id -> id.equals(ticketId))
                .count();
        }
        return TicketTrackingPolicy.super.countTickets(ticketGrantingTicket, ticketId);
    }
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