@RepeatedTest(1)
    @Tag("DisableTicketRegistryTestWithEncryption")
    void verifyTicketCountsEqualToTicketsAdded() throws Throwable {
        assumeTrue(canTicketRegistryIterate());
        val ticketGrantingTickets = new ArrayList<Ticket>();
        val serviceTickets = new ArrayList<Ticket>();
        FunctionUtils.doAndRetry(callback -> {
            ticketGrantingTickets.clear();
            serviceTickets.clear();
            for (var i = 0; i < TICKETS_IN_REGISTRY; i++) {
                val auth = CoreAuthenticationTestUtils.getAuthentication();
                val service = RegisteredServiceTestUtils.getService();
                val ticketGrantingTicket = new TicketGrantingTicketImpl(TicketGrantingTicket.PREFIX + '-' + i,
                    auth, NeverExpiresExpirationPolicy.INSTANCE);
                val st = ticketGrantingTicket.grantServiceTicket("ST-" + i,
                    service, NeverExpiresExpirationPolicy.INSTANCE, false, serviceTicketSessionTrackingPolicy);
                ticketGrantingTickets.add(ticketGrantingTicket);
                serviceTickets.add(st);
                val addedTicket = ticketRegistry.addTicket(ticketGrantingTicket);
                await().untilAsserted(() -> assertNotNull(ticketRegistry.getTicket(addedTicket.getId())));
                val addedServiceTicket = ticketRegistry.addTicket(st);
                await().untilAsserted(() -> assertNotNull(ticketRegistry.getTicket(addedServiceTicket.getId())));
            }
            await().untilAsserted(() -> {
                val sessionCount = ticketRegistry.sessionCount();
                assertEquals(ticketGrantingTickets.size(), sessionCount,
                    () -> "The sessionCount " + sessionCount + " is not the same as the collection " + ticketGrantingTickets.size());
            });

            await().untilAsserted(() -> {
                val ticketCount = ticketRegistry.serviceTicketCount();
                assertEquals(serviceTickets.size(), ticketCount,
                    () -> "The serviceTicketCount " + ticketCount + " is not the same as the collection " + serviceTickets.size());
            });
            return null;
        });
    }
Exercise block of code in {@link AbstractTicketRegistry#getTicket(String ticketId)} that runs when
the method encounters a {@link Ticket} created in the future.
Adds 10 seconds to creation time to simulate time out of sync so warning will be logged.
core/cas-server-core-tickets/src/test/java/org/apereo/cas/ticket/registry/BaseTicketRegistryTests.java