protected static String getPrincipalIdFrom(final Ticket ticket) {
        return ticket instanceof final AuthenticationAwareTicket authenticationAwareTicket
            ? Optional.ofNullable(authenticationAwareTicket.getAuthentication())
            .map(auth -> auth.getPrincipal().getId()).orElse(StringUtils.EMPTY)
            : StringUtils.EMPTY;
    }
Base ticket registry class that implements common ticket-related ops.

@author Scott Battaglia
@since 3.0.0
core/cas-server-core-tickets-api/src/main/java/org/apereo/cas/ticket/registry/AbstractTicketRegistry.java