protected long countTicketsByTicketType(final Class<? extends Ticket> ticketType) {
        val ticketDefinitions = ticketCatalog.findTicketImplementations(ticketType);
        return ticketDefinitions
            .stream()
            .mapToLong(defn -> FunctionUtils.doUnchecked(() -> {
                val collection = getTicketCollectionInstanceByMetadata(defn);
                return firestore.collection(collection)
                    .whereEqualTo("prefix", digestIdentifier(defn.getPrefix()))
                    .count().get().get().getCount();
            }))
            .sum();
    }
This is {@link GoogleCloudFirestoreTicketRegistry}.

@author Misagh Moayyed
@since 7.0.0
support/cas-server-support-gcp-firestore-ticket-registry/src/main/java/org/apereo/cas/ticket/registry/GoogleCloudFirestoreTicketRegistry.java