@Override
    public long deleteSingleTicket(final Ticket ticket) {
        val result = ticket != null ? deleteTicketFromQueue(ticket.getId()) : 0;
        if (ticketPublisher.isEnabled()) {
            LOGGER.trace("Publishing delete command for id [{}] and ticket [{}]", publisherIdentifier, ticket.getId());
            ticketPublisher.publishMessageToQueue(new DeleteTicketMessageQueueCommand(publisherIdentifier, ticket.getId()));
        }
        return result;
    }
This is {@link AbstractMapBasedTicketRegistry}.

@author Misagh Moayyed
@since 5.2.0
core/cas-server-core-tickets-api/src/main/java/org/apereo/cas/ticket/registry/AbstractMapBasedTicketRegistry.java