protected Ticket toEncodedTicket(final Ticket ticket, final byte[] encodedTicketObject) throws Exception {
        val encodedTicketId = digestIdentifier(ticket.getId());
        return new DefaultEncodedTicket(encodedTicketId,
            ByteSource.wrap(encodedTicketObject).read(), ticket.getPrefix());
    }
Delete ticket-granting ticket's service tickets.

@param ticket the ticket
@return the count of tickets that were removed including child tickets and zero if the ticket was not deleted
core/cas-server-core-tickets-api/src/main/java/org/apereo/cas/ticket/registry/AbstractTicketRegistry.java