code: protected <T extends TicketGrantingTicket> T produceTicket(final Authentication authentication,
                                                                 final String tgtId, final Class<T> clazz) {
          val result = new TicketGrantingTicketImpl(tgtId, authentication, this.ticketGrantingTicketExpirationPolicy);
          if (!clazz.isAssignableFrom(result.getClass())) {
              throw new ClassCastException("Result [" + result
                  + " is of type " + result.getClass()
                  + " when we were expecting " + clazz);
          }
          return (T) result;
      }
docs: Produce ticket.
  
  @param <T>            the type parameter
  @param authentication the authentication
  @param tgtId          the tgt id
  @param clazz          the clazz
  @return the ticket.