@Override
    public <T extends Ticket> T deserializeTicket(final String ticketContent, final Class<T> clazz) {
        val serializer = Objects.requireNonNull(ticketSerializationExecutionPlan.getTicketSerializer(clazz),
            () -> "Unable to find ticket deserializer for " + clazz.getSimpleName());
        LOGGER.trace("Unmarshalling ticket content from [{}]", ticketContent);
        val ticket = serializer.from(ticketContent);
        if (ticket == null) {
            throw new InvalidTicketException(clazz.getName());
        }
        if (!clazz.isAssignableFrom(ticket.getClass())) {
            throw new ClassCastException("Ticket [" + ticket.getId()
                                         + " is of type " + ticket.getClass()
                                         + " when we were expecting " + clazz);
        }
        return (T) ticket;
    }
This is {@link DefaultTicketStringSerializationManager}.

@author Misagh Moayyed
@since 6.1.0
core/cas-server-core-tickets-api/src/main/java/org/apereo/cas/ticket/serialization/DefaultTicketStringSerializationManager.java