@Override
    public int compareTo(@Nonnull final TicketDefinition definition) {
        return Comparator
            .comparing(TicketDefinition::getPrefix)
            .thenComparing(TicketDefinition::getImplementationClass, Comparator.comparing(Class::getName))
            .thenComparing(TicketDefinition::getApiClass, Comparator.comparing(Class::getName))
            .compare(this, definition);
    }
This is {@link DefaultTicketDefinition}.

@author Misagh Moayyed
@since 5.1.0
core/cas-server-core-tickets-api/src/main/java/org/apereo/cas/ticket/DefaultTicketDefinition.java