@Override
    public String compact(final StringBuilder builder, final Ticket ticket) throws Exception {
        val transientTicket = (TransientSessionTicket) ticket;
        builder.append(String.format("%s%s", DELIMITER, transientTicket.getService() != null
            ? transientTicket.getService().getShortenedId() : StringUtils.EMPTY));
        
        val properties = transientTicket.getProperties()
            .entrySet()
            .stream()
            .map(entry -> {
                val values = CollectionUtils.toCollection(entry.getValue())
                    .stream()
                    .map(Object::toString)
                    .collect(Collectors.joining(";"));
                return entry.getKey() + '=' + values;
            })
            .reduce((s1, s2) -> s1 + '|' + s2)
            .orElse(StringUtils.EMPTY);
        builder.append(String.format("%s%s", DELIMITER, properties));
        return builder.toString();
    }
This is {@link TransientSessionTicketCompactor}.

@author Misagh Moayyed
@since 7.0.0
support/cas-server-support-stateless-ticket-registry/src/main/java/org/apereo/cas/ticket/registry/compact/TransientSessionTicketCompactor.java